On Sun, Dec 27, 2020 at 09:14:53AM -0400, Fabien COELHO wrote: > > src/test/regress/sql/create_am.sql:CREATE ACCESS METHOD heap2 TYPE TABLE > > HANDLER heap_tableam_handler; > > ... > > src/test/regress/sql/create_am.sql:DROP ACCESS METHOD heap2; > > > Or maybe using SET default_tablespace instead of modifying the CREATE sql. > > That'd need to be done separately for indexes, and RESET after creating the > > tables, to avoid accidentally affecting indexes, too. > > Why should it not affect indexes?
I rarely use pgbench, and probably never looked at its source before, but I saw that it has a separate --tablespace and --index-tablespace, and that --tablespace is *not* the default for indexes. So if we changed it to use SET default_tablespace instead of amending the DDL sql, we'd need to make sure the SET applied only to the intended CREATE command, and not all following create commands. In the case that --index-tablespace is not specified, it would be buggy to do this: SET default_tablespace=foo; CREATE TABLE ... CREATE INDEX ... CREATE TABLE ... CREATE INDEX ... ... -- Justin PS. Thanks for patching it to work with partitioned tables :)