Commit c8b6cba8 authored by Andres Freund's avatar Andres Freund

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
parent 1ec4a970
...@@ -149,7 +149,7 @@ postgres=# SELECT pg_drop_replication_slot('regression_slot'); ...@@ -149,7 +149,7 @@ postgres=# SELECT pg_drop_replication_slot('regression_slot');
another connection. another connection.
</para> </para>
<programlisting> <programlisting>
# pg_recvlogical -d postgres --slot test --create # pg_recvlogical -d postgres --slot test --create-slot
# pg_recvlogical -d postgres --slot test --start -f - # pg_recvlogical -d postgres --slot test --start -f -
CTRL-Z CTRL-Z
# psql -d postgres -c "INSERT INTO data(data) VALUES('4');" # psql -d postgres -c "INSERT INTO data(data) VALUES('4');"
...@@ -158,7 +158,7 @@ BEGIN 693 ...@@ -158,7 +158,7 @@ BEGIN 693
table public.data: INSERT: id[integer]:4 data[text]:'4' table public.data: INSERT: id[integer]:4 data[text]:'4'
COMMIT 693 COMMIT 693
CTRL-C CTRL-C
# pg_recvlogical -d postgres --slot test --drop # pg_recvlogical -d postgres --slot test --drop-slot
</programlisting> </programlisting>
</sect1> </sect1>
<sect1 id="logicaldecoding-explanation"> <sect1 id="logicaldecoding-explanation">
......
...@@ -53,7 +53,7 @@ PostgreSQL documentation ...@@ -53,7 +53,7 @@ PostgreSQL documentation
<variablelist> <variablelist>
<varlistentry> <varlistentry>
<term><option>--create</option></term> <term><option>--create-slot</option></term>
<listitem> <listitem>
<para> <para>
Create a new logical replication slot with the name specified in Create a new logical replication slot with the name specified in
...@@ -82,7 +82,7 @@ PostgreSQL documentation ...@@ -82,7 +82,7 @@ PostgreSQL documentation
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term><option>--drop</option></term> <term><option>--drop-slot</option></term>
<listitem> <listitem>
<para> <para>
Drop the replication slot with the name specified Drop the replication slot with the name specified
...@@ -266,8 +266,9 @@ PostgreSQL documentation ...@@ -266,8 +266,9 @@ PostgreSQL documentation
<listitem> <listitem>
<para> <para>
In <option>--start</option> mode, use the existing logical replication slot named In <option>--start</option> mode, use the existing logical replication slot named
<replaceable>slot_name</replaceable>. In <option>--create</option> mode, create the <replaceable>slot_name</replaceable>. In <option>--create-slot</option>
slot with this name. In <option>--drop</option> mode, delete the slot with this name. mode, create the slot with this name. In <option>--drop-slot</option>
mode, delete the slot with this name.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
......
...@@ -91,9 +91,9 @@ usage(void) ...@@ -91,9 +91,9 @@ usage(void)
" time between status packets sent to server (default: %d)\n"), (standby_message_timeout / 1000)); " time between status packets sent to server (default: %d)\n"), (standby_message_timeout / 1000));
printf(_(" -S, --slot=SLOT name of the logical replication slot\n")); printf(_(" -S, --slot=SLOT name of the logical replication slot\n"));
printf(_("\nAction to be performed:\n")); printf(_("\nAction to be performed:\n"));
printf(_(" --create create a new replication slot (for the slot's name see --slot)\n")); printf(_(" --create-slot create a new replication slot (for the slot's name see --slot)\n"));
printf(_(" --drop-slot drop the replication slot (for the slot's name see --slot)\n"));
printf(_(" --start start streaming in a replication slot (for the slot's name see --slot)\n")); printf(_(" --start start streaming in a replication slot (for the slot's name see --slot)\n"));
printf(_(" --drop drop the replication slot (for the slot's name see --slot)\n"));
printf(_("\nReport bugs to <pgsql-bugs@postgresql.org>.\n")); printf(_("\nReport bugs to <pgsql-bugs@postgresql.org>.\n"));
} }
...@@ -618,9 +618,9 @@ main(int argc, char **argv) ...@@ -618,9 +618,9 @@ main(int argc, char **argv)
{"status-interval", required_argument, NULL, 's'}, {"status-interval", required_argument, NULL, 's'},
{"slot", required_argument, NULL, 'S'}, {"slot", required_argument, NULL, 'S'},
/* action */ /* action */
{"create", no_argument, NULL, 1}, {"create-slot", no_argument, NULL, 1},
{"start", no_argument, NULL, 2}, {"start", no_argument, NULL, 2},
{"drop", no_argument, NULL, 3}, {"drop-slot", no_argument, NULL, 3},
{NULL, 0, NULL, 0} {NULL, 0, NULL, 0}
}; };
int c; int c;
...@@ -814,7 +814,7 @@ main(int argc, char **argv) ...@@ -814,7 +814,7 @@ main(int argc, char **argv)
if (do_drop_slot && (do_create_slot || do_start_slot)) if (do_drop_slot && (do_create_slot || do_start_slot))
{ {
fprintf(stderr, _("%s: cannot use --create or --start together with --drop\n"), progname); fprintf(stderr, _("%s: cannot use --create-slot or --start together with --drop-slot\n"), progname);
fprintf(stderr, _("Try \"%s --help\" for more information.\n"), fprintf(stderr, _("Try \"%s --help\" for more information.\n"),
progname); progname);
exit(1); exit(1);
...@@ -822,7 +822,7 @@ main(int argc, char **argv) ...@@ -822,7 +822,7 @@ main(int argc, char **argv)
if (startpos != InvalidXLogRecPtr && (do_create_slot || do_drop_slot)) if (startpos != InvalidXLogRecPtr && (do_create_slot || do_drop_slot))
{ {
fprintf(stderr, _("%s: cannot use --create or --drop together with --startpos\n"), progname); fprintf(stderr, _("%s: cannot use --create-slot or --drop-slot together with --startpos\n"), progname);
fprintf(stderr, _("Try \"%s --help\" for more information.\n"), fprintf(stderr, _("Try \"%s --help\" for more information.\n"),
progname); progname);
exit(1); exit(1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment