Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 010a1b5

Browse files
committed
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>
1 parent f0ca540 commit 010a1b5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/bin/pg_rewind/pg_rewind.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,13 @@ main(int argc, char **argv)
158158
exit(1);
159159
}
160160

161+
if (datadir_source != NULL && connstr_source != NULL)
162+
{
163+
fprintf(stderr, _("%s: only one of --source-pgdata or --source-server can be specified\n"), progname);
164+
fprintf(stderr, _("Try \"%s --help\" for more information.\n"), progname);
165+
exit(1);
166+
}
167+
161168
if (datadir_target == NULL)
162169
{
163170
fprintf(stderr, _("%s: no target data directory specified (--target-pgdata)\n"), progname);

0 commit comments

Comments
 (0)