From 6488ecabd25d2921ba693177dd25614be5df64d5 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Tue, 16 Apr 2013 18:32:46 +0100 Subject: [PATCH] Added --moveidx command line option The option is only parsed, not implemented yet. --- bin/pg_repack.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bin/pg_repack.c b/bin/pg_repack.c index 41240d9..c3b8b16 100644 --- a/bin/pg_repack.c +++ b/bin/pg_repack.c @@ -198,6 +198,7 @@ static bool noorder = false; static SimpleStringList table_list = {NULL, NULL}; static char *orderby = NULL; static char *tablespace = NULL; +static bool moveidx = false; static int wait_timeout = 60; /* in seconds */ static int jobs = 0; /* number of concurrent worker conns. */ @@ -216,6 +217,7 @@ static pgut_option options[] = { 'b', 'n', "no-order", &noorder }, { 's', 'o', "order-by", &orderby }, { 's', 's', "tablespace", &tablespace }, + { 'b', 'S', "moveidx", &moveidx }, { 'i', 'T', "wait-timeout", &wait_timeout }, { 'B', 'Z', "no-analyze", &analyze }, { 'i', 'j', "jobs", &jobs }, @@ -256,6 +258,12 @@ main(int argc, char *argv[]) errmsg("%s", errbuf))); } + if (moveidx && tablespace == NULL) + { + ereport(ERROR, + (errcode(EINVAL), + errmsg("cannot specify --moveidx (-S) without --tablespace (-s)"))); + } return 0; } @@ -1464,6 +1472,7 @@ pgut_help(bool details) printf(" -o, --order-by=COLUMNS order by columns instead of cluster keys\n"); printf(" -t, --table=TABLE repack specific table only\n"); printf(" -s, --tablespace=TABLESPC move repacked tables to a new tablespace\n"); + printf(" -S, --moveidx move repacked indexes to TABLESPC too\n"); printf(" -T, --wait-timeout=SECS timeout to cancel other backends on conflict\n"); printf(" -Z, --no-analyze don't analyze at end\n"); }