From e1f41aa6d805ed0a7018c6c09f89f61c22907dca Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Thu, 23 Mar 2017 16:05:59 +0300 Subject: [PATCH] add new option checks for -C --- bin/pg_repack.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bin/pg_repack.c b/bin/pg_repack.c index a996a0d..fc7b039 100644 --- a/bin/pg_repack.c +++ b/bin/pg_repack.c @@ -311,9 +311,15 @@ main(int argc, char *argv[]) else if (r_index.head && only_indexes) ereport(ERROR, (errcode(EINVAL), errmsg("cannot specify --index (-i) and --only-indexes (-x)"))); + else if (r_index.head && exclude_extension_list.head) + ereport(ERROR, (errcode(EINVAL), + errmsg("cannot specify --index (-i) and --exclude-extension (-C)"))); else if (only_indexes && !table_list.head) ereport(ERROR, (errcode(EINVAL), errmsg("cannot repack all indexes of database, specify the table(s) via --table (-t)"))); + else if (only_indexes && exclude_extension_list.head) + ereport(ERROR, (errcode(EINVAL), + errmsg("cannot specify --only-indexes (-x) and --exclude-extension (-C)"))); else if (alldb) ereport(ERROR, (errcode(EINVAL), errmsg("cannot repack specific index(es) in all databases"))); @@ -343,6 +349,11 @@ main(int argc, char *argv[]) (errcode(EINVAL), errmsg("cannot repack specific table(s) in schema, use schema.table notation instead"))); + if (exclude_extension_list.head && table_list.head) + ereport(ERROR, + (errcode(EINVAL), + errmsg("cannot specify --table (-t) and --exclude-extension (-C)"))); + if (noorder) orderby = "";