Skip to content

Commit c8b6cba

Browse files
committed
Rename pg_recvlogical's --create/--drop to --create-slot/--drop-slot.
A future patch (9.5 only) adds slot management to pg_receivexlog. The verbs create/drop don't seem descriptive enough there. It seems better to rename pg_recvlogical's commands now, in beta, than live with the inconsistency forever. The old form (e.g. --drop) will still be accepted by virtue of most getopt_long() options accepting abbreviations for long commands. Backpatch to 9.4 where pg_recvlogical was introduced. Author: Michael Paquier and Andres Freund Discussion: CAB7nPqQtt79U6FmhwvgqJmNyWcVCbbV-nS72j_jyPEopERg9rg@mail.gmail.com
1 parent 1ec4a97 commit c8b6cba

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

doc/src/sgml/logicaldecoding.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ postgres=# SELECT pg_drop_replication_slot('regression_slot');
149149
another connection.
150150
</para>
151151
<programlisting>
152-
# pg_recvlogical -d postgres --slot test --create
152+
# pg_recvlogical -d postgres --slot test --create-slot
153153
# pg_recvlogical -d postgres --slot test --start -f -
154154
CTRL-Z
155155
# psql -d postgres -c "INSERT INTO data(data) VALUES('4');"
@@ -158,7 +158,7 @@ BEGIN 693
158158
table public.data: INSERT: id[integer]:4 data[text]:'4'
159159
COMMIT 693
160160
CTRL-C
161-
# pg_recvlogical -d postgres --slot test --drop
161+
# pg_recvlogical -d postgres --slot test --drop-slot
162162
</programlisting>
163163
</sect1>
164164
<sect1 id="logicaldecoding-explanation">

doc/src/sgml/ref/pg_recvlogical.sgml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ PostgreSQL documentation
5353
<variablelist>
5454

5555
<varlistentry>
56-
<term><option>--create</option></term>
56+
<term><option>--create-slot</option></term>
5757
<listitem>
5858
<para>
5959
Create a new logical replication slot with the name specified in
@@ -82,7 +82,7 @@ PostgreSQL documentation
8282
</varlistentry>
8383

8484
<varlistentry>
85-
<term><option>--drop</option></term>
85+
<term><option>--drop-slot</option></term>
8686
<listitem>
8787
<para>
8888
Drop the replication slot with the name specified
@@ -266,8 +266,9 @@ PostgreSQL documentation
266266
<listitem>
267267
<para>
268268
In <option>--start</option> mode, use the existing logical replication slot named
269-
<replaceable>slot_name</replaceable>. In <option>--create</option> mode, create the
270-
slot with this name. In <option>--drop</option> mode, delete the slot with this name.
269+
<replaceable>slot_name</replaceable>. In <option>--create-slot</option>
270+
mode, create the slot with this name. In <option>--drop-slot</option>
271+
mode, delete the slot with this name.
271272
</para>
272273
</listitem>
273274
</varlistentry>

src/bin/pg_basebackup/pg_recvlogical.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ usage(void)
9191
" time between status packets sent to server (default: %d)\n"), (standby_message_timeout / 1000));
9292
printf(_(" -S, --slot=SLOT name of the logical replication slot\n"));
9393
printf(_("\nAction to be performed:\n"));
94-
printf(_(" --create create a new replication slot (for the slot's name see --slot)\n"));
94+
printf(_(" --create-slot create a new replication slot (for the slot's name see --slot)\n"));
95+
printf(_(" --drop-slot drop the replication slot (for the slot's name see --slot)\n"));
9596
printf(_(" --start start streaming in a replication slot (for the slot's name see --slot)\n"));
96-
printf(_(" --drop drop the replication slot (for the slot's name see --slot)\n"));
9797
printf(_("\nReport bugs to <pgsql-bugs@postgresql.org>.\n"));
9898
}
9999

@@ -618,9 +618,9 @@ main(int argc, char **argv)
618618
{"status-interval", required_argument, NULL, 's'},
619619
{"slot", required_argument, NULL, 'S'},
620620
/* action */
621-
{"create", no_argument, NULL, 1},
621+
{"create-slot", no_argument, NULL, 1},
622622
{"start", no_argument, NULL, 2},
623-
{"drop", no_argument, NULL, 3},
623+
{"drop-slot", no_argument, NULL, 3},
624624
{NULL, 0, NULL, 0}
625625
};
626626
int c;
@@ -814,15 +814,15 @@ main(int argc, char **argv)
814814

815815
if (do_drop_slot && (do_create_slot || do_start_slot))
816816
{
817-
fprintf(stderr, _("%s: cannot use --create or --start together with --drop\n"), progname);
817+
fprintf(stderr, _("%s: cannot use --create-slot or --start together with --drop-slot\n"), progname);
818818
fprintf(stderr, _("Try \"%s --help\" for more information.\n"),
819819
progname);
820820
exit(1);
821821
}
822822

823823
if (startpos != InvalidXLogRecPtr && (do_create_slot || do_drop_slot))
824824
{
825-
fprintf(stderr, _("%s: cannot use --create or --drop together with --startpos\n"), progname);
825+
fprintf(stderr, _("%s: cannot use --create-slot or --drop-slot together with --startpos\n"), progname);
826826
fprintf(stderr, _("Try \"%s --help\" for more information.\n"),
827827
progname);
828828
exit(1);

0 commit comments

Comments
 (0)