Merge in Pull Request #20 from Steeve Lennmark.
Adds support for repacking only the tables in a specified schema. This doesn't support --only-indexes mode, but that seems alright for now. Fix merge conflicts, and make a few tweaks along the way: * bump version to 1.3-dev0 * add Beena to list of maintainers * documentation wordsmithing * fix up the INFO message printed for each index in --index or --only-indexes mode, so that it is only printed once per index, and prints the name of the original index, not that of the transient index_%u name.
This commit is contained in:
@ -325,6 +325,8 @@ 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"
|
||||
INFO: repacking index "public"."tbl_pk_uk_pkey"
|
||||
INFO: repacking index "public"."tbl_pk_uk_col2_col1_key"
|
||||
-- => 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
|
||||
@ -361,3 +363,27 @@ INFO: repacking table "trg4"
|
||||
\! pg_repack --dbname=contrib_regression --table=tbl_cluster --dry-run
|
||||
INFO: Dry run enabled, not executing repack
|
||||
INFO: repacking table "tbl_cluster"
|
||||
-- Test --schema
|
||||
--
|
||||
CREATE SCHEMA test_schema1;
|
||||
CREATE TABLE test_schema1.tbl1 (id INTEGER PRIMARY KEY);
|
||||
CREATE TABLE test_schema1.tbl2 (id INTEGER PRIMARY KEY);
|
||||
CREATE SCHEMA test_schema2;
|
||||
CREATE TABLE test_schema2.tbl1 (id INTEGER PRIMARY KEY);
|
||||
CREATE TABLE test_schema2.tbl2 (id INTEGER PRIMARY KEY);
|
||||
-- => OK
|
||||
\! pg_repack --dbname=contrib_regression --schema=test_schema1
|
||||
INFO: repacking table "test_schema1.tbl1"
|
||||
INFO: repacking table "test_schema1.tbl2"
|
||||
-- => OK
|
||||
\! pg_repack --dbname=contrib_regression --schema=test_schema1 --schema=test_schema2
|
||||
INFO: repacking table "test_schema2.tbl1"
|
||||
INFO: repacking table "test_schema2.tbl2"
|
||||
INFO: repacking table "test_schema1.tbl2"
|
||||
INFO: repacking table "test_schema1.tbl1"
|
||||
-- => ERROR
|
||||
\! pg_repack --dbname=contrib_regression --schema=test_schema1 --table=tbl1
|
||||
ERROR: cannot repack specific table(s) in schema, use schema.table notation instead
|
||||
-- => ERROR
|
||||
\! pg_repack --dbname=contrib_regression --all --schema=test_schema1
|
||||
ERROR: cannot repack specific schema(s) in all databases
|
||||
|
Reference in New Issue
Block a user