aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2016-10-07 14:35:17 +0300
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2016-10-07 14:35:45 +0300
commit010a1b5614cc6a26b35ea04ba85271baa0e929ac (patch)
tree694dd5a9621c71c415c7ba322fc8d4392276345c
parentf0ca540374ee89b45bce83b499327ffd934344a8 (diff)
downloadpostgresql-010a1b5614cc6a26b35ea04ba85271baa0e929ac.tar.gz
postgresql-010a1b5614cc6a26b35ea04ba85271baa0e929ac.zip
Don't allow both --source-server and --source-target args to pg_rewind.
They are supposed to be mutually exclusive, but there was no check for that. Michael Banck Discussion: <20161007103414.GD12247@nighthawk.caipicrew.dd-dns.de>
-rw-r--r--src/bin/pg_rewind/pg_rewind.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/bin/pg_rewind/pg_rewind.c b/src/bin/pg_rewind/pg_rewind.c
index 9f2f08ebc41..cc0568064f9 100644
--- a/src/bin/pg_rewind/pg_rewind.c
+++ b/src/bin/pg_rewind/pg_rewind.c
@@ -158,6 +158,13 @@ main(int argc, char **argv)
exit(1);
}
+ if (datadir_source != NULL && connstr_source != NULL)
+ {
+ fprintf(stderr, _("%s: only one of --source-pgdata or --source-server can be specified\n"), progname);
+ fprintf(stderr, _("Try \"%s --help\" for more information.\n"), progname);
+ exit(1);
+ }
+
if (datadir_target == NULL)
{
fprintf(stderr, _("%s: no target data directory specified (--target-pgdata)\n"), progname);