Make the 'repacking index ...' message be displayed
for indexes-only repacks (not just when in dry-run mode).
This commit is contained in:
parent
69aa4f741d
commit
4eb1cef99e
@ -1683,6 +1683,7 @@ repack_table_indexes(PGresult *index_details)
|
||||
"WHERE pgc.relname = 'index_%u' "
|
||||
"AND nsp.nspname = $1", index);
|
||||
params[0] = schema_name;
|
||||
elog(INFO, "repacking index \"%s\".\"index_%u\"", schema_name, index);
|
||||
res = execute(sql.data, 1, params);
|
||||
if (PQresultStatus(res) != PGRES_TUPLES_OK)
|
||||
{
|
||||
@ -1705,10 +1706,7 @@ repack_table_indexes(PGresult *index_details)
|
||||
}
|
||||
|
||||
if (dryrun)
|
||||
{
|
||||
elog(INFO, "repacking index \"%s\".\"index_%u\"", schema_name, index);
|
||||
continue;
|
||||
}
|
||||
|
||||
params[0] = utoa(index, buffer[0]);
|
||||
res = execute("SELECT repack.repack_indexdef($1, $2, $3, true)", 3,
|
||||
|
@ -323,6 +323,9 @@ INFO: repacking table "tbl_nn_uk"
|
||||
\! pg_repack --dbname=contrib_regression --table=tbl_pk_uk
|
||||
INFO: repacking table "tbl_pk_uk"
|
||||
-- => OK
|
||||
\! pg_repack --dbname=contrib_regression --table=tbl_pk_uk --only-indexes
|
||||
INFO: repacking indexes of "tbl_pk_uk"
|
||||
-- => OK
|
||||
\! pg_repack --dbname=contrib_regression --table=tbl_nn_puk
|
||||
WARNING: relation "tbl_nn_puk" must have a primary key or not-null unique keys
|
||||
-- => WARNING
|
||||
|
@ -185,6 +185,8 @@ CREATE UNIQUE INDEX tbl_nn_puk_pcol1_idx ON tbl_nn_puk(col1) WHERE col1 < 10;
|
||||
-- => OK
|
||||
\! pg_repack --dbname=contrib_regression --table=tbl_pk_uk
|
||||
-- => OK
|
||||
\! pg_repack --dbname=contrib_regression --table=tbl_pk_uk --only-indexes
|
||||
-- => OK
|
||||
\! pg_repack --dbname=contrib_regression --table=tbl_nn_puk
|
||||
-- => WARNING
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user