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

Commit f0c1085

Browse files
committed
Consistently spell a replication slot's name as slot_name.
Previously there's been a mix between 'slotname' and 'slot_name'. It's not nice to be unneccessarily inconsistent in a new feature. As a post beta1 initdb now is required in the wake of eeca4cd, fix the inconsistencies. Most the changes won't affect usage of replication slots because the majority of changes is around function parameter names. The prominent exception to that is that the recovery.conf parameter 'primary_slotname' is now named 'primary_slot_name'.
1 parent e0cb4aa commit f0c1085

File tree

11 files changed

+50
-50
lines changed

11 files changed

+50
-50
lines changed

doc/src/sgml/func.sgml

+14-14
Original file line numberDiff line numberDiff line change
@@ -16609,14 +16609,14 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup());
1660916609
<indexterm>
1661016610
<primary>pg_create_physical_replication_slot</primary>
1661116611
</indexterm>
16612-
<literal><function>pg_create_physical_replication_slot(<parameter>slotname</parameter> <type>name</type>)</function></literal>
16612+
<literal><function>pg_create_physical_replication_slot(<parameter>slot_name</parameter> <type>name</type>)</function></literal>
1661316613
</entry>
1661416614
<entry>
16615-
(<parameter>slotname</parameter> <type>name</type>, <parameter>xlog_position</parameter> <type>pg_lsn</type>)
16615+
(<parameter>slot_name</parameter> <type>name</type>, <parameter>xlog_position</parameter> <type>pg_lsn</type>)
1661616616
</entry>
1661716617
<entry>
1661816618
Creates a new physical replication slot named
16619-
<parameter>slotname</parameter>. Streaming changes from a physical slot
16619+
<parameter>slot_name</parameter>. Streaming changes from a physical slot
1662016620
is only possible with the walsender protocol - see <xref
1662116621
linkend="protocol-replication">. Corresponds to the walsender protocol
1662216622
command <literal>CREATE_REPLICATION_SLOT ... PHYSICAL</literal>.
@@ -16627,14 +16627,14 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup());
1662716627
<indexterm>
1662816628
<primary>pg_drop_replication_slot</primary>
1662916629
</indexterm>
16630-
<literal><function>pg_drop_replication_slot(<parameter>slotname</parameter> <type>name</type>)</function></literal>
16630+
<literal><function>pg_drop_replication_slot(<parameter>slot_name</parameter> <type>name</type>)</function></literal>
1663116631
</entry>
1663216632
<entry>
1663316633
<type>void</type>
1663416634
</entry>
1663516635
<entry>
1663616636
Drops the physical or logical replication slot
16637-
named <parameter>slotname</parameter>. Same as walsender protocol
16637+
named <parameter>slot_name</parameter>. Same as walsender protocol
1663816638
command <literal>DROP_REPLICATION_SLOT</>.
1663916639
</entry>
1664016640
</row>
@@ -16644,14 +16644,14 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup());
1664416644
<indexterm>
1664516645
<primary>pg_create_logical_replication_slot</primary>
1664616646
</indexterm>
16647-
<literal><function>pg_create_logical_replication_slot(<parameter>slotname</parameter> <type>name</type>, <parameter>plugin</parameter> <type>name</type>)</function></literal>
16647+
<literal><function>pg_create_logical_replication_slot(<parameter>slot_name</parameter> <type>name</type>, <parameter>plugin</parameter> <type>name</type>)</function></literal>
1664816648
</entry>
1664916649
<entry>
16650-
(<parameter>slotname</parameter> <type>name</type>, <parameter>xlog_position</parameter> <type>pg_lsn</type>)
16650+
(<parameter>slot_name</parameter> <type>name</type>, <parameter>xlog_position</parameter> <type>pg_lsn</type>)
1665116651
</entry>
1665216652
<entry>
1665316653
Creates a new logical (decoding) replication slot named
16654-
<parameter>slotname</parameter> using the output plugin
16654+
<parameter>slot_name</parameter> using the output plugin
1665516655
<parameter>plugin</parameter>. A call to this function has the same
1665616656
effect as the replication protocol command
1665716657
<literal>CREATE REPLICATION SLOT ... LOGICAL</literal>.
@@ -16663,16 +16663,16 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup());
1666316663
<indexterm>
1666416664
<primary>pg_logical_slot_get_changes</primary>
1666516665
</indexterm>
16666-
<literal><function>pg_logical_slot_get_changes(<parameter>slotname</parameter> <type>name</type>, <parameter>upto_lsn</parameter> <type>pg_lsn</type>, <parameter>upto_nchanges</parameter> <type>int</type>, VARIADIC <parameter>options</parameter> <type>text[]</type>)</function></literal>
16666+
<literal><function>pg_logical_slot_get_changes(<parameter>slot_name</parameter> <type>name</type>, <parameter>upto_lsn</parameter> <type>pg_lsn</type>, <parameter>upto_nchanges</parameter> <type>int</type>, VARIADIC <parameter>options</parameter> <type>text[]</type>)</function></literal>
1666716667
</entry>
1666816668
<entry>
1666916669
(<parameter>location</parameter> <type>pg_lsn</type>, <parameter>xid</parameter> <type>xid</type>, <parameter>data</parameter> <type>text</type>)
1667016670
</entry>
1667116671
<entry>
16672-
Returns changes in the slot <parameter>slotname</parameter>, starting
16672+
Returns changes in the slot <parameter>slot_name</parameter>, starting
1667316673
from the point at which since changes have been consumed last. If
1667416674
<parameter>upto_lsn</> and <parameter>upto_nchanges</> are NULL,
16675-
logical decoding will continue until end of WAL. If
16675+
logical decoding will continue until end of WAL. If
1667616676
<parameter>upto_lsn</> is non-NULL, decoding will include only
1667716677
those transactions which commit prior to the specified LSN. If
1667816678
<parameter>upto_nchanges</parameter> is non-NULL, decoding will
@@ -16688,7 +16688,7 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup());
1668816688
<indexterm>
1668916689
<primary>pg_logical_slot_peek_changes</primary>
1669016690
</indexterm>
16691-
<literal><function>pg_logical_slot_peek_changes(<parameter>slotname</parameter> <type>name</type>, <parameter>upto_lsn</parameter> <type>pg_lsn</type>, <parameter>upto_nchanges</parameter> <type>int</type>, VARIADIC <parameter>options</parameter> <type>text[]</type>)</function></literal>
16691+
<literal><function>pg_logical_slot_peek_changes(<parameter>slot_name</parameter> <type>name</type>, <parameter>upto_lsn</parameter> <type>pg_lsn</type>, <parameter>upto_nchanges</parameter> <type>int</type>, VARIADIC <parameter>options</parameter> <type>text[]</type>)</function></literal>
1669216692
</entry>
1669316693
<entry>
1669416694
(<parameter>location</parameter> <type>text</type>, <parameter>xid</parameter> <type>xid</type>, <parameter>data</parameter> <type>text</type>)
@@ -16706,7 +16706,7 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup());
1670616706
<indexterm>
1670716707
<primary>pg_logical_slot_get_binary_changes</primary>
1670816708
</indexterm>
16709-
<literal><function>pg_logical_slot_get_binary_changes(<parameter>slotname</parameter> <type>name</type>, <parameter>upto_lsn</parameter> <type>pg_lsn</type>, <parameter>upto_nchanges</parameter> <type>int</type>, VARIADIC <parameter>options</parameter> <type>text[]</type>)</function></literal>
16709+
<literal><function>pg_logical_slot_get_binary_changes(<parameter>slot_name</parameter> <type>name</type>, <parameter>upto_lsn</parameter> <type>pg_lsn</type>, <parameter>upto_nchanges</parameter> <type>int</type>, VARIADIC <parameter>options</parameter> <type>text[]</type>)</function></literal>
1671016710
</entry>
1671116711
<entry>
1671216712
(<parameter>location</parameter> <type>pg_lsn</type>, <parameter>xid</parameter> <type>xid</type>, <parameter>data</parameter> <type>bytea</type>)
@@ -16723,7 +16723,7 @@ postgres=# SELECT * FROM pg_xlogfile_name_offset(pg_stop_backup());
1672316723
<indexterm>
1672416724
<primary>pg_logical_slot_peek_binary_changes</primary>
1672516725
</indexterm>
16726-
<literal><function>pg_logical_slot_peek_binary_changes(<parameter>slotname</parameter> <type>name</type>, <parameter>upto_lsn</parameter> <type>pg_lsn</type>, <parameter>upto_nchanges</parameter> <type>int</type>, VARIADIC <parameter>options</parameter> <type>text[]</type>)</function></literal>
16726+
<literal><function>pg_logical_slot_peek_binary_changes(<parameter>slot_name</parameter> <type>name</type>, <parameter>upto_lsn</parameter> <type>pg_lsn</type>, <parameter>upto_nchanges</parameter> <type>int</type>, VARIADIC <parameter>options</parameter> <type>text[]</type>)</function></literal>
1672716727
</entry>
1672816728
<entry>
1672916729
(<parameter>location</parameter> <type>pg_lsn</type>, <parameter>xid</parameter> <type>xid</type>, <parameter>data</parameter> <type>bytea</type>)

doc/src/sgml/high-availability.sgml

+3-3
Original file line numberDiff line numberDiff line change
@@ -929,7 +929,7 @@ primary_conninfo = 'host=192.168.1.50 port=5432 user=foo password=foopass'
929929
You can create a replication slot like this:
930930
<programlisting>
931931
postgres=# SELECT * FROM pg_create_physical_replication_slot('node_a_slot');
932-
slotname | xlog_position
932+
slot_name | xlog_position
933933
-------------+---------------
934934
node_a_slot |
935935

@@ -939,13 +939,13 @@ postgres=# SELECT * FROM pg_replication_slots;
939939
node_a_slot | physical | | | f | |
940940
(1 row)
941941
</programlisting>
942-
To configure the standby to use this slot, <varname>primary_slotname</>
942+
To configure the standby to use this slot, <varname>primary_slot_name</>
943943
should be configured in the standby's <filename>recovery.conf</>.
944944
Here is a simple example:
945945
<programlisting>
946946
standby_mode = 'on'
947947
primary_conninfo = 'host=192.168.1.50 port=5432 user=foo password=foopass'
948-
primary_slotname = 'node_a_slot'
948+
primary_slot_name = 'node_a_slot'
949949
</programlisting>
950950
</para>
951951
</sect3>

doc/src/sgml/logicaldecoding.sgml

+4-4
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
<programlisting>
5555
postgres=# -- Create a slot named 'regression_slot' using the output plugin 'test_decoding'
5656
postgres=# SELECT * FROM pg_create_logical_replication_slot('regression_slot', 'test_decoding');
57-
slotname | xlog_position
57+
slot_name | xlog_position
5858
-----------------+---------------
5959
regression_slot | 0/16B1970
6060
(1 row)
@@ -256,9 +256,9 @@ CTRL-C
256256
<sect1 id="logicaldecoding-walsender">
257257
<title>Streaming Replication Protocol Interface</title>
258258
<para>
259-
The <literal>CREATE_REPLICATION_SLOT slotname LOGICAL
260-
options</literal>, <literal>DROP_REPLICATION_SLOT slotname</literal>
261-
and <literal>START_REPLICATION SLOT slotname LOGICAL options</literal>
259+
The <literal>CREATE_REPLICATION_SLOT slot_name LOGICAL
260+
options</literal>, <literal>DROP_REPLICATION_SLOT slot_name</literal>
261+
and <literal>START_REPLICATION SLOT slot_name LOGICAL options</literal>
262262
commands can be used to create, drop and stream changes from a replication
263263
slot respectively. These commands are only available over a replication
264264
connection; they cannot be used via SQL.

doc/src/sgml/protocol.sgml

+8-8
Original file line numberDiff line numberDiff line change
@@ -1428,7 +1428,7 @@ The commands accepted in walsender mode are:
14281428
</varlistentry>
14291429

14301430
<varlistentry>
1431-
<term>CREATE_REPLICATION_SLOT <replaceable class="parameter">slotname</> { <literal>PHYSICAL</> | <literal>LOGICAL</> <replaceable class="parameter">output_plugin</> } <indexterm><primary>CREATE_REPLICATION_SLOT</primary></indexterm></term>
1431+
<term>CREATE_REPLICATION_SLOT <replaceable class="parameter">slot_name</> { <literal>PHYSICAL</> | <literal>LOGICAL</> <replaceable class="parameter">output_plugin</> } <indexterm><primary>CREATE_REPLICATION_SLOT</primary></indexterm></term>
14321432
<listitem>
14331433
<para>
14341434
Create a physical or logical replication
@@ -1437,7 +1437,7 @@ The commands accepted in walsender mode are:
14371437
</para>
14381438
<variablelist>
14391439
<varlistentry>
1440-
<term><replaceable class="parameter">slotname</></term>
1440+
<term><replaceable class="parameter">slot_name</></term>
14411441
<listitem>
14421442
<para>
14431443
The name of the slot to create. Must be a valid replication slot
@@ -1460,7 +1460,7 @@ The commands accepted in walsender mode are:
14601460
</varlistentry>
14611461

14621462
<varlistentry>
1463-
<term>START_REPLICATION [<literal>SLOT</literal> <replaceable class="parameter">slotname</>] [<literal>PHYSICAL</literal>] <replaceable class="parameter">XXX/XXX</> [<literal>TIMELINE</literal> <replaceable class="parameter">tli</>]</term>
1463+
<term>START_REPLICATION [<literal>SLOT</literal> <replaceable class="parameter">slot_name</>] [<literal>PHYSICAL</literal>] <replaceable class="parameter">XXX/XXX</> [<literal>TIMELINE</literal> <replaceable class="parameter">tli</>]</term>
14641464
<listitem>
14651465
<para>
14661466
Instructs server to start streaming WAL, starting at
@@ -1506,7 +1506,7 @@ The commands accepted in walsender mode are:
15061506

15071507
<para>
15081508
If a slot's name is provided
1509-
via <replaceable class="parameter">slotname</>, it will be updated
1509+
via <replaceable class="parameter">slot_name</>, it will be updated
15101510
as replication progresses so that the server knows which WAL segments -
15111511
and if <varname>hot_standby_feedback</> is on which transactions -
15121512
are still needed by the standby.
@@ -1788,7 +1788,7 @@ The commands accepted in walsender mode are:
17881788
</listitem>
17891789
</varlistentry>
17901790
<varlistentry>
1791-
<term>START_REPLICATION <literal>SLOT</literal> <replaceable class="parameter">slotname</> <literal>LOGICAL</literal> <replaceable class="parameter">XXX/XXX</> [ ( <replaceable>option_name</replaceable> [<replaceable>option_value</replaceable>] [, ... ] ) ]</term>
1791+
<term>START_REPLICATION <literal>SLOT</literal> <replaceable class="parameter">slot_name</> <literal>LOGICAL</literal> <replaceable class="parameter">XXX/XXX</> [ ( <replaceable>option_name</replaceable> [<replaceable>option_value</replaceable>] [, ... ] ) ]</term>
17921792
<listitem>
17931793
<para>
17941794
Instructs server to start streaming WAL for logical replication, starting
@@ -1810,7 +1810,7 @@ The commands accepted in walsender mode are:
18101810

18111811
<variablelist>
18121812
<varlistentry>
1813-
<term><literal>SLOT</literal> <replaceable class="parameter">slotname</></term>
1813+
<term><literal>SLOT</literal> <replaceable class="parameter">slot_name</></term>
18141814
<listitem>
18151815
<para>
18161816
The name of the slot to stream changes from. This parameter is required,
@@ -1850,15 +1850,15 @@ The commands accepted in walsender mode are:
18501850
</varlistentry>
18511851

18521852
<varlistentry>
1853-
<term>DROP_REPLICATION_SLOT <replaceable class="parameter">slotname</></term>
1853+
<term>DROP_REPLICATION_SLOT <replaceable class="parameter">slot_name</></term>
18541854
<listitem>
18551855
<para>
18561856
Drops a replication slot, freeing any reserved server-side resources. If
18571857
the slot is currently in use by an active connection, this command fails.
18581858
</para>
18591859
<variablelist>
18601860
<varlistentry>
1861-
<term><replaceable class="parameter">slotname</></term>
1861+
<term><replaceable class="parameter">slot_name</></term>
18621862
<listitem>
18631863
<para>
18641864
The name of the slot to drop.

doc/src/sgml/recovery-config.sgml

+3-3
Original file line numberDiff line numberDiff line change
@@ -370,10 +370,10 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"' # Windows
370370
</para>
371371
</listitem>
372372
</varlistentry>
373-
<varlistentry id="primary-slotname" xreflabel="primary_slotname">
374-
<term><varname>primary_slotname</varname> (<type>string</type>)
373+
<varlistentry id="primary-slot-name" xreflabel="primary_slot_name">
374+
<term><varname>primary_slot_name</varname> (<type>string</type>)
375375
<indexterm>
376-
<primary><varname>primary_slotname</> recovery parameter</primary>
376+
<primary><varname>primary_slot_name</> recovery parameter</primary>
377377
</indexterm>
378378
</term>
379379
<listitem>

src/backend/access/transam/recovery.conf.sample

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
# removal on the upstream node. This setting has no effect if primary_conninfo
126126
# is not set.
127127
#
128-
#primary_slotname = ''
128+
#primary_slot_name = ''
129129
#
130130
# By default, a standby server keeps restoring XLOG records from the
131131
# primary indefinitely. If you want to stop the standby mode, finish recovery

src/backend/access/transam/xlog.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -5221,12 +5221,12 @@ readRecoveryCommandFile(void)
52215221
(errmsg_internal("primary_conninfo = '%s'",
52225222
PrimaryConnInfo)));
52235223
}
5224-
else if (strcmp(item->name, "primary_slotname") == 0)
5224+
else if (strcmp(item->name, "primary_slot_name") == 0)
52255225
{
52265226
ReplicationSlotValidateName(item->value, ERROR);
52275227
PrimarySlotName = pstrdup(item->value);
52285228
ereport(DEBUG2,
5229-
(errmsg_internal("primary_slotname = '%s'",
5229+
(errmsg_internal("primary_slot_name = '%s'",
52305230
PrimarySlotName)));
52315231
}
52325232
else if (strcmp(item->name, "trigger_file") == 0)

src/backend/catalog/system_views.sql

+4-4
Original file line numberDiff line numberDiff line change
@@ -850,31 +850,31 @@ CREATE OR REPLACE FUNCTION
850850
RETURNS SETOF record LANGUAGE internal STABLE ROWS 100 AS 'jsonb_to_recordset';
851851

852852
CREATE OR REPLACE FUNCTION pg_logical_slot_get_changes(
853-
IN slotname name, IN upto_lsn pg_lsn, IN upto_nchanges int, VARIADIC options text[] DEFAULT '{}',
853+
IN slot_name name, IN upto_lsn pg_lsn, IN upto_nchanges int, VARIADIC options text[] DEFAULT '{}',
854854
OUT location pg_lsn, OUT xid xid, OUT data text)
855855
RETURNS SETOF RECORD
856856
LANGUAGE INTERNAL
857857
VOLATILE ROWS 1000 COST 1000
858858
AS 'pg_logical_slot_get_changes';
859859

860860
CREATE OR REPLACE FUNCTION pg_logical_slot_peek_changes(
861-
IN slotname name, IN upto_lsn pg_lsn, IN upto_nchanges int, VARIADIC options text[] DEFAULT '{}',
861+
IN slot_name name, IN upto_lsn pg_lsn, IN upto_nchanges int, VARIADIC options text[] DEFAULT '{}',
862862
OUT location pg_lsn, OUT xid xid, OUT data text)
863863
RETURNS SETOF RECORD
864864
LANGUAGE INTERNAL
865865
VOLATILE ROWS 1000 COST 1000
866866
AS 'pg_logical_slot_peek_changes';
867867

868868
CREATE OR REPLACE FUNCTION pg_logical_slot_get_binary_changes(
869-
IN slotname name, IN upto_lsn pg_lsn, IN upto_nchanges int, VARIADIC options text[] DEFAULT '{}',
869+
IN slot_name name, IN upto_lsn pg_lsn, IN upto_nchanges int, VARIADIC options text[] DEFAULT '{}',
870870
OUT location pg_lsn, OUT xid xid, OUT data bytea)
871871
RETURNS SETOF RECORD
872872
LANGUAGE INTERNAL
873873
VOLATILE ROWS 1000 COST 1000
874874
AS 'pg_logical_slot_get_binary_changes';
875875

876876
CREATE OR REPLACE FUNCTION pg_logical_slot_peek_binary_changes(
877-
IN slotname name, IN upto_lsn pg_lsn, IN upto_nchanges int, VARIADIC options text[] DEFAULT '{}',
877+
IN slot_name name, IN upto_lsn pg_lsn, IN upto_nchanges int, VARIADIC options text[] DEFAULT '{}',
878878
OUT location pg_lsn, OUT xid xid, OUT data bytea)
879879
RETURNS SETOF RECORD
880880
LANGUAGE INTERNAL

src/bin/pg_basebackup/pg_recvlogical.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,11 @@ usage(void)
8989
printf(_(" -P, --plugin=PLUGIN use output plugin PLUGIN (default: %s)\n"), plugin);
9090
printf(_(" -s, --status-interval=SECS\n"
9191
" time between status packets sent to server (default: %d)\n"), (standby_message_timeout / 1000));
92-
printf(_(" -S, --slot=SLOT use existing replication slot SLOT instead of starting a new one\n"));
92+
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 slotname see --slot)\n"));
95-
printf(_(" --start start streaming in a replication slot (for the slotname see --slot)\n"));
96-
printf(_(" --drop drop the replication slot (for the slotname see --slot)\n"));
94+
printf(_(" --create create a new replication slot (for the slot's name see --slot)\n"));
95+
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

src/include/catalog/catversion.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@
5353
*/
5454

5555
/* yyyymmddN */
56-
#define CATALOG_VERSION_NO 201406041
56+
#define CATALOG_VERSION_NO 201406051
5757

5858
#endif

0 commit comments

Comments
 (0)