Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit70fd0e1

Browse files
committed
Don't start to stream after pg_receivexlog --create-slot.
Immediately starting to stream after --create-slot is inconvenient in anumber of situations (e.g. when configuring a slot for use inrecovery.conf) and it's easy to just call pg_receivexlog twice in therest of the cases.Author: Michael PaquierDiscussion: CAB7nPqQ9qEtuDiKY3OpNzHcz5iUA+DUX9FcN9K8GUkCZvG7+Ew@mail.gmail.comBackpatch: 9.5, where the option was introduced
1 parent1e3e1ae commit70fd0e1

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

‎doc/src/sgml/ref/pg_receivexlog.sgml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ PostgreSQL documentation
273273
<listitem>
274274
<para>
275275
Create a new physical replication slot with the name specified in
276-
<option>--slot</option>, thenstart to stream WAL.
276+
<option>--slot</option>, thenexit.
277277
</para>
278278
</listitem>
279279
</varlistentry>

‎src/bin/pg_basebackup/pg_receivexlog.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ main(int argc, char **argv)
508508
/*
509509
* Required arguments
510510
*/
511-
if (basedir==NULL&& !do_drop_slot)
511+
if (basedir==NULL&& !do_drop_slot&& !do_create_slot)
512512
{
513513
fprintf(stderr,_("%s: no target directory specified\n"),progname);
514514
fprintf(stderr,_("Try \"%s --help\" for more information.\n"),
@@ -519,7 +519,7 @@ main(int argc, char **argv)
519519
/*
520520
* Check existence of destination folder.
521521
*/
522-
if (!do_drop_slot)
522+
if (!do_drop_slot&& !do_create_slot)
523523
{
524524
DIR*dir=get_destination_dir(basedir);
525525

@@ -584,6 +584,7 @@ main(int argc, char **argv)
584584
if (!CreateReplicationSlot(conn,replication_slot,NULL, true,
585585
slot_exists_ok))
586586
disconnect_and_exit(1);
587+
disconnect_and_exit(0);
587588
}
588589

589590
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp