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:
Josh Kupershmidt
2014-05-24 15:42:24 -04:00
7 changed files with 105 additions and 13 deletions

View File

@ -135,6 +135,9 @@ INFO: repacking table "testts1"
--move all indexes of the table to a tablespace
\! pg_repack --dbname=contrib_regression --table=testts1 --only-indexes --tablespace=testts
INFO: repacking indexes of "testts1"
INFO: repacking index "public"."testts1_pkey"
INFO: repacking index "public"."testts1_partial_idx"
INFO: repacking index "public"."testts1_with_idx"
SELECT relname, spcname
FROM pg_class JOIN pg_tablespace ts ON ts.oid = reltablespace
WHERE relname ~ '^testts1'
@ -149,6 +152,9 @@ ORDER BY relname;
--all indexes of tablespace remain in same tablespace
\! pg_repack --dbname=contrib_regression --table=testts1 --only-indexes
INFO: repacking indexes of "testts1"
INFO: repacking index "public"."testts1_pkey"
INFO: repacking index "public"."testts1_partial_idx"
INFO: repacking index "public"."testts1_with_idx"
SELECT relname, spcname
FROM pg_class JOIN pg_tablespace ts ON ts.oid = reltablespace
WHERE relname ~ '^testts1'
@ -163,6 +169,9 @@ ORDER BY relname;
--move all indexes of the table to pg_default
\! pg_repack --dbname=contrib_regression --table=testts1 --only-indexes --tablespace=pg_default
INFO: repacking indexes of "testts1"
INFO: repacking index "public"."testts1_pkey"
INFO: repacking index "public"."testts1_partial_idx"
INFO: repacking index "public"."testts1_with_idx"
SELECT relname, spcname
FROM pg_class JOIN pg_tablespace ts ON ts.oid = reltablespace
WHERE relname ~ '^testts1'
@ -173,7 +182,7 @@ ORDER BY relname;
--move one index to a tablespace
\! pg_repack --dbname=contrib_regression --index=testts1_pkey --tablespace=testts
INFO: repacking "testts1_pkey"
INFO: repacking index "public"."testts1_pkey"
SELECT relname, spcname
FROM pg_class JOIN pg_tablespace ts ON ts.oid = reltablespace
WHERE relname ~ '^testts1'
@ -185,7 +194,7 @@ ORDER BY relname;
--index tablespace stays as is
\! pg_repack --dbname=contrib_regression --index=testts1_pkey
INFO: repacking "testts1_pkey"
INFO: repacking index "public"."testts1_pkey"
SELECT relname, spcname
FROM pg_class JOIN pg_tablespace ts ON ts.oid = reltablespace
WHERE relname ~ '^testts1'
@ -197,7 +206,7 @@ ORDER BY relname;
--move index to pg_default
\! pg_repack --dbname=contrib_regression --index=testts1_pkey --tablespace=pg_default
INFO: repacking "testts1_pkey"
INFO: repacking index "public"."testts1_pkey"
SELECT relname, spcname
FROM pg_class JOIN pg_tablespace ts ON ts.oid = reltablespace
WHERE relname ~ '^testts1'
@ -208,8 +217,8 @@ ORDER BY relname;
--using multiple --index option
\! pg_repack --dbname=contrib_regression --index=testts1_pkey --index=testts1_with_idx --tablespace=testts
INFO: repacking "testts1_pkey"
INFO: repacking "testts1_with_idx"
INFO: repacking index "public"."testts1_pkey"
INFO: repacking index "public"."testts1_with_idx"
SELECT relname, spcname
FROM pg_class JOIN pg_tablespace ts ON ts.oid = reltablespace
WHERE relname ~ '^testts1'