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>
This commit is contained in:
Heikki Linnakangas 2016-10-07 14:35:17 +03:00
parent 275bf98601
commit 0d4d7d6185
1 changed files with 7 additions and 0 deletions

View File

@ -162,6 +162,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);