Skip to content

Commit 3d0b02c

Browse files
committed
Try to repack all tables with pkey, not only the ones with ckey
This is consistent with --no-order not been required anymore.
1 parent b3304b8 commit 3d0b02c

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

bin/expected/repack.out

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,20 @@ SELECT * FROM tbl_with_dropped_toast;
114114
--
115115
-- do repack
116116
--
117+
\! pg_repack --dbname=contrib_regression --table=tbl_cluster
118+
INFO: repacking table "tbl_cluster"
117119
\! pg_repack --dbname=contrib_regression --table=tbl_badindex
118120
INFO: repacking table "tbl_badindex"
119121
WARNING: skipping invalid index: CREATE UNIQUE INDEX idx_badindex_n ON tbl_badindex USING btree (n)
120122
\! pg_repack --dbname=contrib_regression
121123
INFO: repacking table "tbl_cluster"
124+
INFO: repacking table "tbl_only_pkey"
125+
INFO: repacking table "tbl_gistkey"
122126
INFO: repacking table "tbl_with_dropped_column"
123127
INFO: repacking table "tbl_with_dropped_toast"
124-
\! pg_repack --dbname=contrib_regression --table=tbl_cluster
125-
INFO: repacking table "tbl_cluster"
128+
INFO: repacking table "tbl_badindex"
129+
WARNING: skipping invalid index: CREATE UNIQUE INDEX idx_badindex_n ON tbl_badindex USING btree (n)
130+
INFO: repacking table "tbl_idxopts"
126131
--
127132
-- after
128133
--

bin/pg_repack.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -521,8 +521,6 @@ repack_one_database(const char *orderby, char *errbuf, size_t errsize)
521521
else
522522
{
523523
appendStringInfoString(&sql, "pkid IS NOT NULL");
524-
if (!orderby)
525-
appendStringInfoString(&sql, " AND ckid IS NOT NULL");
526524
}
527525

528526
/* double check the parameters array is sane */

bin/sql/repack.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ SELECT * FROM tbl_with_dropped_toast;
120120
-- do repack
121121
--
122122

123+
\! pg_repack --dbname=contrib_regression --table=tbl_cluster
123124
\! pg_repack --dbname=contrib_regression --table=tbl_badindex
124125
\! pg_repack --dbname=contrib_regression
125-
\! pg_repack --dbname=contrib_regression --table=tbl_cluster
126126

127127
--
128128
-- after

0 commit comments

Comments
 (0)