1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-12 21:01:52 +03:00

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
This commit is contained in:
Amit Kapila
2023-10-13 12:13:46 +05:30
parent d16eb83aba
commit 536f410111
4 changed files with 32 additions and 22 deletions

View File

@ -274,9 +274,11 @@
</para> </para>
<para> <para>
Normally, the remote replication slot is created automatically when the Normally, the remote replication slot is created automatically when the
subscription is created using <command>CREATE SUBSCRIPTION</command> and it subscription is created using <link linkend="sql-createsubscription">
<command>CREATE SUBSCRIPTION</command></link> and it
is dropped automatically when the subscription is dropped using is dropped automatically when the subscription is dropped using
<command>DROP SUBSCRIPTION</command>. In some situations, however, it can <link linkend="sql-dropsubscription"><command>DROP SUBSCRIPTION</command></link>.
In some situations, however, it can
be useful or necessary to manipulate the subscription and the underlying be useful or necessary to manipulate the subscription and the underlying
replication slot separately. Here are some scenarios: replication slot separately. Here are some scenarios:
@ -306,8 +308,9 @@
When dropping a subscription, the replication slot should be kept. When dropping a subscription, the replication slot should be kept.
This could be useful when the subscriber database is being moved to a This could be useful when the subscriber database is being moved to a
different host and will be activated from there. In that case, different host and will be activated from there. In that case,
disassociate the slot from the subscription using <command>ALTER disassociate the slot from the subscription using
SUBSCRIPTION</command> before attempting to drop the subscription. <link linkend="sql-altersubscription"><command>ALTER SUBSCRIPTION</command></link>
before attempting to drop the subscription.
</para> </para>
</listitem> </listitem>
@ -1349,7 +1352,8 @@ test_sub=# SELECT * FROM child ORDER BY a;
If a subscription is affected by this problem, the only way to resume If a subscription is affected by this problem, the only way to resume
replication is to adjust one of the column lists on the publication replication is to adjust one of the column lists on the publication
side so that they all match; and then either recreate the subscription, side so that they all match; and then either recreate the subscription,
or use <literal>ALTER SUBSCRIPTION ... DROP PUBLICATION</literal> to or use <link linkend="sql-altersubscription-params-setadddrop-publication">
<literal>ALTER SUBSCRIPTION ... DROP PUBLICATION</literal></link> to
remove one of the offending publications and add it again. remove one of the offending publications and add it again.
</para> </para>
</warning> </warning>
@ -1504,13 +1508,15 @@ CONTEXT: processing remote data for replication origin "pg_16395" during "INSER
the replication origin name can be found from the server log (LSN 0/14C0378 and the replication origin name can be found from the server log (LSN 0/14C0378 and
replication origin <literal>pg_16395</literal> in the above case). The replication origin <literal>pg_16395</literal> in the above case). The
transaction that produced the conflict can be skipped by using transaction that produced the conflict can be skipped by using
<command>ALTER SUBSCRIPTION ... SKIP</command> with the finish LSN <link linkend="sql-altersubscription-params-skip"><command>ALTER SUBSCRIPTION ... SKIP</command></link>
with the finish LSN
(i.e., LSN 0/14C0378). The finish LSN could be an LSN at which the transaction (i.e., LSN 0/14C0378). The finish LSN could be an LSN at which the transaction
is committed or prepared on the publisher. Alternatively, the transaction can is committed or prepared on the publisher. Alternatively, the transaction can
also be skipped by calling the <link linkend="pg-replication-origin-advance"> also be skipped by calling the <link linkend="pg-replication-origin-advance">
<function>pg_replication_origin_advance()</function></link> function. <function>pg_replication_origin_advance()</function></link> function.
Before using this function, the subscription needs to be disabled temporarily Before using this function, the subscription needs to be disabled temporarily
either by <command>ALTER SUBSCRIPTION ... DISABLE</command> or, the either by <link linkend="sql-altersubscription-params-disable">
<command>ALTER SUBSCRIPTION ... DISABLE</command></link> or, the
subscription can be used with the subscription can be used with the
<link linkend="sql-createsubscription-with-disable-on-error"><literal>disable_on_error</literal></link> <link linkend="sql-createsubscription-with-disable-on-error"><literal>disable_on_error</literal></link>
option. Then, you can use <function>pg_replication_origin_advance()</function> option. Then, you can use <function>pg_replication_origin_advance()</function>

View File

@ -51,7 +51,8 @@ ALTER PUBLICATION <replaceable class="parameter">name</replaceable> RENAME TO <r
<literal>ADD</literal> and <literal>DROP</literal> clauses will add and <literal>ADD</literal> and <literal>DROP</literal> clauses will add and
remove one or more tables/schemas from the publication. Note that adding remove one or more tables/schemas from the publication. Note that adding
tables/schemas to a publication that is already subscribed to will require an tables/schemas to a publication that is already subscribed to will require an
<literal>ALTER SUBSCRIPTION ... REFRESH PUBLICATION</literal> action on the <link linkend="sql-altersubscription-params-refresh-publication">
<literal>ALTER SUBSCRIPTION ... REFRESH PUBLICATION</literal></link> action on the
subscribing side in order to become effective. Note also that subscribing side in order to become effective. Note also that
<literal>DROP TABLES IN SCHEMA</literal> will not drop any schema tables <literal>DROP TABLES IN SCHEMA</literal> will not drop any schema tables
that were specified using that were specified using

View File

@ -85,7 +85,7 @@ ALTER SUBSCRIPTION <replaceable class="parameter">name</replaceable> RENAME TO <
<title>Parameters</title> <title>Parameters</title>
<variablelist> <variablelist>
<varlistentry> <varlistentry id="sql-altersubscription-params-name">
<term><replaceable class="parameter">name</replaceable></term> <term><replaceable class="parameter">name</replaceable></term>
<listitem> <listitem>
<para> <para>
@ -94,7 +94,7 @@ ALTER SUBSCRIPTION <replaceable class="parameter">name</replaceable> RENAME TO <
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry id="sql-altersubscription-params-connection">
<term><literal>CONNECTION '<replaceable class="parameter">conninfo</replaceable>'</literal></term> <term><literal>CONNECTION '<replaceable class="parameter">conninfo</replaceable>'</literal></term>
<listitem> <listitem>
<para> <para>
@ -105,7 +105,7 @@ ALTER SUBSCRIPTION <replaceable class="parameter">name</replaceable> RENAME TO <
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry id="sql-altersubscription-params-setadddrop-publication">
<term><literal>SET PUBLICATION <replaceable class="parameter">publication_name</replaceable></literal></term> <term><literal>SET PUBLICATION <replaceable class="parameter">publication_name</replaceable></literal></term>
<term><literal>ADD PUBLICATION <replaceable class="parameter">publication_name</replaceable></literal></term> <term><literal>ADD PUBLICATION <replaceable class="parameter">publication_name</replaceable></literal></term>
<term><literal>DROP PUBLICATION <replaceable class="parameter">publication_name</replaceable></literal></term> <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 <
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry id="sql-altersubscription-params-refresh-publication">
<term><literal>REFRESH PUBLICATION</literal></term> <term><literal>REFRESH PUBLICATION</literal></term>
<listitem> <listitem>
<para> <para>
Fetch missing table information from publisher. This will start Fetch missing table information from publisher. This will start
replication of tables that were added to the subscribed-to publications replication of tables that were added to the subscribed-to publications
since <command>CREATE SUBSCRIPTION</command> or since <link linkend="sql-createsubscription">
<command>CREATE SUBSCRIPTION</command></link> or
the last invocation of <command>REFRESH PUBLICATION</command>. the last invocation of <command>REFRESH PUBLICATION</command>.
</para> </para>
@ -192,7 +193,7 @@ ALTER SUBSCRIPTION <replaceable class="parameter">name</replaceable> RENAME TO <
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry id="sql-altersubscription-params-enable">
<term><literal>ENABLE</literal></term> <term><literal>ENABLE</literal></term>
<listitem> <listitem>
<para> <para>
@ -202,7 +203,7 @@ ALTER SUBSCRIPTION <replaceable class="parameter">name</replaceable> RENAME TO <
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry id="sql-altersubscription-params-disable">
<term><literal>DISABLE</literal></term> <term><literal>DISABLE</literal></term>
<listitem> <listitem>
<para> <para>
@ -212,7 +213,7 @@ ALTER SUBSCRIPTION <replaceable class="parameter">name</replaceable> RENAME TO <
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry id="sql-altersubscription-params-set">
<term><literal>SET ( <replaceable class="parameter">subscription_parameter</replaceable> [= <replaceable class="parameter">value</replaceable>] [, ... ] )</literal></term> <term><literal>SET ( <replaceable class="parameter">subscription_parameter</replaceable> [= <replaceable class="parameter">value</replaceable>] [, ... ] )</literal></term>
<listitem> <listitem>
<para> <para>
@ -232,7 +233,7 @@ ALTER SUBSCRIPTION <replaceable class="parameter">name</replaceable> RENAME TO <
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry id="sql-altersubscription-params-skip">
<term><literal>SKIP ( <replaceable class="parameter">skip_option</replaceable> = <replaceable class="parameter">value</replaceable> )</literal></term> <term><literal>SKIP ( <replaceable class="parameter">skip_option</replaceable> = <replaceable class="parameter">value</replaceable> )</literal></term>
<listitem> <listitem>
<para> <para>
@ -272,7 +273,7 @@ ALTER SUBSCRIPTION <replaceable class="parameter">name</replaceable> RENAME TO <
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry id="sql-altersubscription-params-new-owner">
<term><replaceable class="parameter">new_owner</replaceable></term> <term><replaceable class="parameter">new_owner</replaceable></term>
<listitem> <listitem>
<para> <para>
@ -281,7 +282,7 @@ ALTER SUBSCRIPTION <replaceable class="parameter">name</replaceable> RENAME TO <
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry id="sql-altersubscription-params-new-name">
<term><replaceable class="parameter">new_name</replaceable></term> <term><replaceable class="parameter">new_name</replaceable></term>
<listitem> <listitem>
<para> <para>

View File

@ -40,7 +40,7 @@ DROP SUBSCRIPTION [ IF EXISTS ] <replaceable class="parameter">name</replaceable
<para> <para>
<command>DROP SUBSCRIPTION</command> cannot be executed inside a <command>DROP SUBSCRIPTION</command> cannot be executed inside a
transaction block if the subscription is associated with a replication transaction block if the subscription is associated with a replication
slot. (You can use <command>ALTER SUBSCRIPTION</command> to unset the slot. (You can use <link linkend="sql-altersubscription"><command>ALTER SUBSCRIPTION</command></link> to unset the
slot.) slot.)
</para> </para>
</refsect1> </refsect1>
@ -87,9 +87,11 @@ DROP SUBSCRIPTION [ IF EXISTS ] <replaceable class="parameter">name</replaceable
replication slot cannot be dropped or does not exist or never existed, replication slot cannot be dropped or does not exist or never existed,
the <command>DROP SUBSCRIPTION</command> command will fail. To proceed the <command>DROP SUBSCRIPTION</command> command will fail. To proceed
in this situation, first disable the subscription by executing in this situation, first disable the subscription by executing
<literal>ALTER SUBSCRIPTION ... DISABLE</literal>, and then disassociate <link linkend="sql-altersubscription-params-disable">
<literal>ALTER SUBSCRIPTION ... DISABLE</literal></link>, and then disassociate
it from the replication slot by executing it from the replication slot by executing
<literal>ALTER SUBSCRIPTION ... SET (slot_name = NONE)</literal>. <link linkend="sql-altersubscription-params-set">
<literal>ALTER SUBSCRIPTION ... SET (slot_name = NONE)</literal></link>.
After that, <command>DROP SUBSCRIPTION</command> will no longer attempt any After that, <command>DROP SUBSCRIPTION</command> will no longer attempt any
actions on a remote host. Note that if the remote replication slot still actions on a remote host. Note that if the remote replication slot still
exists, it (and any related table synchronization slots) should then be exists, it (and any related table synchronization slots) should then be