From 3d0b02c654e8726ee13f6ec7e28f7f1f951cac15 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Wed, 17 Apr 2013 18:56:50 +0100 Subject: [PATCH] Try to repack all tables with pkey, not only the ones with ckey This is consistent with --no-order not been required anymore. --- bin/expected/repack.out | 9 +++++++-- bin/pg_repack.c | 2 -- bin/sql/repack.sql | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/bin/expected/repack.out b/bin/expected/repack.out index 3beabdb..76518f6 100644 --- a/bin/expected/repack.out +++ b/bin/expected/repack.out @@ -114,15 +114,20 @@ SELECT * FROM tbl_with_dropped_toast; -- -- do repack -- +\! pg_repack --dbname=contrib_regression --table=tbl_cluster +INFO: repacking table "tbl_cluster" \! pg_repack --dbname=contrib_regression --table=tbl_badindex INFO: repacking table "tbl_badindex" WARNING: skipping invalid index: CREATE UNIQUE INDEX idx_badindex_n ON tbl_badindex USING btree (n) \! pg_repack --dbname=contrib_regression INFO: repacking table "tbl_cluster" +INFO: repacking table "tbl_only_pkey" +INFO: repacking table "tbl_gistkey" INFO: repacking table "tbl_with_dropped_column" INFO: repacking table "tbl_with_dropped_toast" -\! pg_repack --dbname=contrib_regression --table=tbl_cluster -INFO: repacking table "tbl_cluster" +INFO: repacking table "tbl_badindex" +WARNING: skipping invalid index: CREATE UNIQUE INDEX idx_badindex_n ON tbl_badindex USING btree (n) +INFO: repacking table "tbl_idxopts" -- -- after -- diff --git a/bin/pg_repack.c b/bin/pg_repack.c index b515924..1d84d9f 100644 --- a/bin/pg_repack.c +++ b/bin/pg_repack.c @@ -521,8 +521,6 @@ repack_one_database(const char *orderby, char *errbuf, size_t errsize) else { appendStringInfoString(&sql, "pkid IS NOT NULL"); - if (!orderby) - appendStringInfoString(&sql, " AND ckid IS NOT NULL"); } /* double check the parameters array is sane */ diff --git a/bin/sql/repack.sql b/bin/sql/repack.sql index b3a4a0e..c84a2a2 100644 --- a/bin/sql/repack.sql +++ b/bin/sql/repack.sql @@ -120,9 +120,9 @@ SELECT * FROM tbl_with_dropped_toast; -- do repack -- +\! pg_repack --dbname=contrib_regression --table=tbl_cluster \! pg_repack --dbname=contrib_regression --table=tbl_badindex \! pg_repack --dbname=contrib_regression -\! pg_repack --dbname=contrib_regression --table=tbl_cluster -- -- after