aboutsummaryrefslogtreecommitdiff
path: root/src/bin/pg_basebackup/pg_receivexlog.c
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2015-08-10 13:28:18 +0200
committerAndres Freund <andres@anarazel.de>2015-08-10 13:28:18 +0200
commit70fd0e14e806a4d0ed31b19d92e1f9f140ef686d (patch)
treef77eb2f1da3fb0cfc4bd7b1baf92a23c4768838d /src/bin/pg_basebackup/pg_receivexlog.c
parent1e3e1ae266502eb6a15a788f74d48b7c94196f56 (diff)
downloadpostgresql-70fd0e14e806a4d0ed31b19d92e1f9f140ef686d.tar.gz
postgresql-70fd0e14e806a4d0ed31b19d92e1f9f140ef686d.zip
Don't start to stream after pg_receivexlog --create-slot.
Immediately starting to stream after --create-slot is inconvenient in a number of situations (e.g. when configuring a slot for use in recovery.conf) and it's easy to just call pg_receivexlog twice in the rest of the cases. Author: Michael Paquier Discussion: CAB7nPqQ9qEtuDiKY3OpNzHcz5iUA+DUX9FcN9K8GUkCZvG7+Ew@mail.gmail.com Backpatch: 9.5, where the option was introduced
Diffstat (limited to 'src/bin/pg_basebackup/pg_receivexlog.c')
-rw-r--r--src/bin/pg_basebackup/pg_receivexlog.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/bin/pg_basebackup/pg_receivexlog.c b/src/bin/pg_basebackup/pg_receivexlog.c
index 00536bd0972..ca648d9716a 100644
--- a/src/bin/pg_basebackup/pg_receivexlog.c
+++ b/src/bin/pg_basebackup/pg_receivexlog.c
@@ -508,7 +508,7 @@ main(int argc, char **argv)
/*
* Required arguments
*/
- if (basedir == NULL && !do_drop_slot)
+ if (basedir == NULL && !do_drop_slot && !do_create_slot)
{
fprintf(stderr, _("%s: no target directory specified\n"), progname);
fprintf(stderr, _("Try \"%s --help\" for more information.\n"),
@@ -519,7 +519,7 @@ main(int argc, char **argv)
/*
* Check existence of destination folder.
*/
- if (!do_drop_slot)
+ if (!do_drop_slot && !do_create_slot)
{
DIR *dir = get_destination_dir(basedir);
@@ -584,6 +584,7 @@ main(int argc, char **argv)
if (!CreateReplicationSlot(conn, replication_slot, NULL, true,
slot_exists_ok))
disconnect_and_exit(1);
+ disconnect_and_exit(0);
}
/*