diff --git a/bin/expected/tablespace.out b/bin/expected/tablespace.out index cf9a93e..7a7a769 100644 --- a/bin/expected/tablespace.out +++ b/bin/expected/tablespace.out @@ -78,3 +78,6 @@ ORDER BY relname; ERROR: cannot specify --moveidx (-S) without --tablespace (-s) \! pg_repack --dbname=contrib_regression --no-order --table=testts1 -S ERROR: cannot specify --moveidx (-S) without --tablespace (-s) +-- not broken with order +\! pg_repack --dbname=contrib_regression -o id --table=testts1 --tablespace pg_default --moveidx +INFO: repacking table "testts1" diff --git a/bin/pg_repack.c b/bin/pg_repack.c index a656e1c..ea3fd2a 100644 --- a/bin/pg_repack.c +++ b/bin/pg_repack.c @@ -617,6 +617,7 @@ repack_one_database(const char *orderby, char *errbuf, size_t errsize) /* User specified ORDER BY */ appendStringInfoString(&sql, " ORDER BY "); appendStringInfoString(&sql, orderby); + table.create_table = sql.data; } repack_one_table(&table, orderby); diff --git a/bin/sql/tablespace.sql b/bin/sql/tablespace.sql index 73400e7..1f2c46a 100644 --- a/bin/sql/tablespace.sql +++ b/bin/sql/tablespace.sql @@ -53,3 +53,5 @@ ORDER BY relname; \! pg_repack --dbname=contrib_regression --no-order --table=testts1 --moveidx \! pg_repack --dbname=contrib_regression --no-order --table=testts1 -S +-- not broken with order +\! pg_repack --dbname=contrib_regression -o id --table=testts1 --tablespace pg_default --moveidx