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

Commit 536f410

Browse files
author
Amit Kapila
committed
Doc: Add more links in logical replication pages.
The logical replication pages in the docs mostly have links to corresponding pub/sub commands whenever they are mentioned, but there were some omissions. This patch adds the missing links. Author: Peter Smith Reviewed-by: Vignesh C, Amit Kapila Discussion: https://www.postgresql.org/message-id/flat/CAHut%2BPu2S4RdzYKR7H5_E7QYWyq5hB0hL4EFrYbP91Qso62jeg%40mail.gmail.com
1 parent d16eb83 commit 536f410

File tree

4 files changed

+32
-22
lines changed

4 files changed

+32
-22
lines changed

doc/src/sgml/logical-replication.sgml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -274,9 +274,11 @@
274274
</para>
275275
<para>
276276
Normally, the remote replication slot is created automatically when the
277-
subscription is created using <command>CREATE SUBSCRIPTION</command> and it
277+
subscription is created using <link linkend="sql-createsubscription">
278+
<command>CREATE SUBSCRIPTION</command></link> and it
278279
is dropped automatically when the subscription is dropped using
279-
<command>DROP SUBSCRIPTION</command>. In some situations, however, it can
280+
<link linkend="sql-dropsubscription"><command>DROP SUBSCRIPTION</command></link>.
281+
In some situations, however, it can
280282
be useful or necessary to manipulate the subscription and the underlying
281283
replication slot separately. Here are some scenarios:
282284

@@ -306,8 +308,9 @@
306308
When dropping a subscription, the replication slot should be kept.
307309
This could be useful when the subscriber database is being moved to a
308310
different host and will be activated from there. In that case,
309-
disassociate the slot from the subscription using <command>ALTER
310-
SUBSCRIPTION</command> before attempting to drop the subscription.
311+
disassociate the slot from the subscription using
312+
<link linkend="sql-altersubscription"><command>ALTER SUBSCRIPTION</command></link>
313+
before attempting to drop the subscription.
311314
</para>
312315
</listitem>
313316

@@ -1349,7 +1352,8 @@ test_sub=# SELECT * FROM child ORDER BY a;
13491352
If a subscription is affected by this problem, the only way to resume
13501353
replication is to adjust one of the column lists on the publication
13511354
side so that they all match; and then either recreate the subscription,
1352-
or use <literal>ALTER SUBSCRIPTION ... DROP PUBLICATION</literal> to
1355+
or use <link linkend="sql-altersubscription-params-setadddrop-publication">
1356+
<literal>ALTER SUBSCRIPTION ... DROP PUBLICATION</literal></link> to
13531357
remove one of the offending publications and add it again.
13541358
</para>
13551359
</warning>
@@ -1504,13 +1508,15 @@ CONTEXT: processing remote data for replication origin "pg_16395" during "INSER
15041508
the replication origin name can be found from the server log (LSN 0/14C0378 and
15051509
replication origin <literal>pg_16395</literal> in the above case). The
15061510
transaction that produced the conflict can be skipped by using
1507-
<command>ALTER SUBSCRIPTION ... SKIP</command> with the finish LSN
1511+
<link linkend="sql-altersubscription-params-skip"><command>ALTER SUBSCRIPTION ... SKIP</command></link>
1512+
with the finish LSN
15081513
(i.e., LSN 0/14C0378). The finish LSN could be an LSN at which the transaction
15091514
is committed or prepared on the publisher. Alternatively, the transaction can
15101515
also be skipped by calling the <link linkend="pg-replication-origin-advance">
15111516
<function>pg_replication_origin_advance()</function></link> function.
15121517
Before using this function, the subscription needs to be disabled temporarily
1513-
either by <command>ALTER SUBSCRIPTION ... DISABLE</command> or, the
1518+
either by <link linkend="sql-altersubscription-params-disable">
1519+
<command>ALTER SUBSCRIPTION ... DISABLE</command></link> or, the
15141520
subscription can be used with the
15151521
<link linkend="sql-createsubscription-with-disable-on-error"><literal>disable_on_error</literal></link>
15161522
option. Then, you can use <function>pg_replication_origin_advance()</function>

doc/src/sgml/ref/alter_publication.sgml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ ALTER PUBLICATION <replaceable class="parameter">name</replaceable> RENAME TO <r
5151
<literal>ADD</literal> and <literal>DROP</literal> clauses will add and
5252
remove one or more tables/schemas from the publication. Note that adding
5353
tables/schemas to a publication that is already subscribed to will require an
54-
<literal>ALTER SUBSCRIPTION ... REFRESH PUBLICATION</literal> action on the
54+
<link linkend="sql-altersubscription-params-refresh-publication">
55+
<literal>ALTER SUBSCRIPTION ... REFRESH PUBLICATION</literal></link> action on the
5556
subscribing side in order to become effective. Note also that
5657
<literal>DROP TABLES IN SCHEMA</literal> will not drop any schema tables
5758
that were specified using

doc/src/sgml/ref/alter_subscription.sgml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ ALTER SUBSCRIPTION <replaceable class="parameter">name</replaceable> RENAME TO <
8585
<title>Parameters</title>
8686

8787
<variablelist>
88-
<varlistentry>
88+
<varlistentry id="sql-altersubscription-params-name">
8989
<term><replaceable class="parameter">name</replaceable></term>
9090
<listitem>
9191
<para>
@@ -94,7 +94,7 @@ ALTER SUBSCRIPTION <replaceable class="parameter">name</replaceable> RENAME TO <
9494
</listitem>
9595
</varlistentry>
9696

97-
<varlistentry>
97+
<varlistentry id="sql-altersubscription-params-connection">
9898
<term><literal>CONNECTION '<replaceable class="parameter">conninfo</replaceable>'</literal></term>
9999
<listitem>
100100
<para>
@@ -105,7 +105,7 @@ ALTER SUBSCRIPTION <replaceable class="parameter">name</replaceable> RENAME TO <
105105
</listitem>
106106
</varlistentry>
107107

108-
<varlistentry>
108+
<varlistentry id="sql-altersubscription-params-setadddrop-publication">
109109
<term><literal>SET PUBLICATION <replaceable class="parameter">publication_name</replaceable></literal></term>
110110
<term><literal>ADD PUBLICATION <replaceable class="parameter">publication_name</replaceable></literal></term>
111111
<term><literal>DROP PUBLICATION <replaceable class="parameter">publication_name</replaceable></literal></term>
@@ -147,13 +147,14 @@ ALTER SUBSCRIPTION <replaceable class="parameter">name</replaceable> RENAME TO <
147147
</listitem>
148148
</varlistentry>
149149

150-
<varlistentry>
150+
<varlistentry id="sql-altersubscription-params-refresh-publication">
151151
<term><literal>REFRESH PUBLICATION</literal></term>
152152
<listitem>
153153
<para>
154154
Fetch missing table information from publisher. This will start
155155
replication of tables that were added to the subscribed-to publications
156-
since <command>CREATE SUBSCRIPTION</command> or
156+
since <link linkend="sql-createsubscription">
157+
<command>CREATE SUBSCRIPTION</command></link> or
157158
the last invocation of <command>REFRESH PUBLICATION</command>.
158159
</para>
159160

@@ -192,7 +193,7 @@ ALTER SUBSCRIPTION <replaceable class="parameter">name</replaceable> RENAME TO <
192193
</listitem>
193194
</varlistentry>
194195

195-
<varlistentry>
196+
<varlistentry id="sql-altersubscription-params-enable">
196197
<term><literal>ENABLE</literal></term>
197198
<listitem>
198199
<para>
@@ -202,7 +203,7 @@ ALTER SUBSCRIPTION <replaceable class="parameter">name</replaceable> RENAME TO <
202203
</listitem>
203204
</varlistentry>
204205

205-
<varlistentry>
206+
<varlistentry id="sql-altersubscription-params-disable">
206207
<term><literal>DISABLE</literal></term>
207208
<listitem>
208209
<para>
@@ -212,7 +213,7 @@ ALTER SUBSCRIPTION <replaceable class="parameter">name</replaceable> RENAME TO <
212213
</listitem>
213214
</varlistentry>
214215

215-
<varlistentry>
216+
<varlistentry id="sql-altersubscription-params-set">
216217
<term><literal>SET ( <replaceable class="parameter">subscription_parameter</replaceable> [= <replaceable class="parameter">value</replaceable>] [, ... ] )</literal></term>
217218
<listitem>
218219
<para>
@@ -232,7 +233,7 @@ ALTER SUBSCRIPTION <replaceable class="parameter">name</replaceable> RENAME TO <
232233
</listitem>
233234
</varlistentry>
234235

235-
<varlistentry>
236+
<varlistentry id="sql-altersubscription-params-skip">
236237
<term><literal>SKIP ( <replaceable class="parameter">skip_option</replaceable> = <replaceable class="parameter">value</replaceable> )</literal></term>
237238
<listitem>
238239
<para>
@@ -272,7 +273,7 @@ ALTER SUBSCRIPTION <replaceable class="parameter">name</replaceable> RENAME TO <
272273
</listitem>
273274
</varlistentry>
274275

275-
<varlistentry>
276+
<varlistentry id="sql-altersubscription-params-new-owner">
276277
<term><replaceable class="parameter">new_owner</replaceable></term>
277278
<listitem>
278279
<para>
@@ -281,7 +282,7 @@ ALTER SUBSCRIPTION <replaceable class="parameter">name</replaceable> RENAME TO <
281282
</listitem>
282283
</varlistentry>
283284

284-
<varlistentry>
285+
<varlistentry id="sql-altersubscription-params-new-name">
285286
<term><replaceable class="parameter">new_name</replaceable></term>
286287
<listitem>
287288
<para>

doc/src/sgml/ref/drop_subscription.sgml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ DROP SUBSCRIPTION [ IF EXISTS ] <replaceable class="parameter">name</replaceable
4040
<para>
4141
<command>DROP SUBSCRIPTION</command> cannot be executed inside a
4242
transaction block if the subscription is associated with a replication
43-
slot. (You can use <command>ALTER SUBSCRIPTION</command> to unset the
43+
slot. (You can use <link linkend="sql-altersubscription"><command>ALTER SUBSCRIPTION</command></link> to unset the
4444
slot.)
4545
</para>
4646
</refsect1>
@@ -87,9 +87,11 @@ DROP SUBSCRIPTION [ IF EXISTS ] <replaceable class="parameter">name</replaceable
8787
replication slot cannot be dropped or does not exist or never existed,
8888
the <command>DROP SUBSCRIPTION</command> command will fail. To proceed
8989
in this situation, first disable the subscription by executing
90-
<literal>ALTER SUBSCRIPTION ... DISABLE</literal>, and then disassociate
90+
<link linkend="sql-altersubscription-params-disable">
91+
<literal>ALTER SUBSCRIPTION ... DISABLE</literal></link>, and then disassociate
9192
it from the replication slot by executing
92-
<literal>ALTER SUBSCRIPTION ... SET (slot_name = NONE)</literal>.
93+
<link linkend="sql-altersubscription-params-set">
94+
<literal>ALTER SUBSCRIPTION ... SET (slot_name = NONE)</literal></link>.
9395
After that, <command>DROP SUBSCRIPTION</command> will no longer attempt any
9496
actions on a remote host. Note that if the remote replication slot still
9597
exists, it (and any related table synchronization slots) should then be

0 commit comments

Comments
 (0)