public inbox for [email protected]
help / color / mirror / Atom feedFrom: Amit Kapila <[email protected]>
To: Peter Smith <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: DOCS - Clarify that REFRESH SEQUENCES might be using stale publication data
Date: Thu, 2 Jul 2026 12:18:16 +0530
Message-ID: <CAA4eK1Jr-f1fhELi2XxF=u8NNBBNOPv7dQiNPFsd3twC1w98BA@mail.gmail.com> (raw)
In-Reply-To: <CAHut+PtFkGvZNihGRDoghWNKMfJufEpR9+thbG_8qPQ7RyVN4w@mail.gmail.com>
References: <CAHut+PtFkGvZNihGRDoghWNKMfJufEpR9+thbG_8qPQ7RyVN4w@mail.gmail.com>
On Thu, Jul 2, 2026 at 8:29 AM Peter Smith <[email protected]> wrote:
>
> The docs do refer to "currently subscribed sequences" but do not
> explicitly warn about this gotcha.
>
> PSA: a patch to add a clarifying sentence.
>
It does not add or remove
sequences from the subscription to match the publication.
</para>
+ <para>
+ If the publication's sequence membership has changed,
+ <link linkend="sql-altersubscription-params-refresh-publication">
+ <command>ALTER SUBSCRIPTION ... REFRESH PUBLICATION</command></link>
+ should be run before <literal>REFRESH SEQUENCES</literal> to ensure the
+ subscription's known sequence list is current.
+ </para>
It is already mentioned that this command "does not add or remove
sequences from the subscription to match the publication.". Adding
more information, especially a separate para for the same, appears
like bloating the text in docs. OTOH, I see your point of running
REFRESH PUBLICATION before REFRESH SEQUENCES which I tried to cover in
the existing paragraph. Apart from that, I have merged your
doc-changes from another thread [1] which is on the same topic. Let's
commit them together.
[1] - https://www.postgresql.org/message-id/CAHut%2BPsrVntfrJ8gV45%2B6%3D1bs5dTWD5mU7Q6aKrBnf1vmyZQkQ%40ma...
--
With Regards,
Amit Kapila.
Attachments:
[application/octet-stream] v2-0001-doc-Clarify-sequence-synchronization-commands.patch (3.1K, ../CAA4eK1Jr-f1fhELi2XxF=u8NNBBNOPv7dQiNPFsd3twC1w98BA@mail.gmail.com/2-v2-0001-doc-Clarify-sequence-synchronization-commands.patch)
download | inline diff:
From 38c6b38fb36cca7ce9f2de0f787e3a3a8fec2b3b Mon Sep 17 00:00:00 2001
From: Amit Kapila <[email protected]>
Date: Thu, 2 Jul 2026 11:35:16 +0530
Subject: [PATCH v2] doc: Clarify sequence synchronization commands.
Improve the REFRESH SEQUENCES description in ALTER SUBSCRIPTION to more
accurately explain how it differs from REFRESH PUBLICATION: REFRESH
PUBLICATION synchronizes the subscription's set of sequences with the
publication (adding new and removing dropped sequences), whereas REFRESH
SEQUENCES only re-synchronizes data for the currently subscribed sequences
without changing which sequences are subscribed. Also advise running
REFRESH PUBLICATION first when the publication's set of sequences has
changed.
In the "Replicating Sequences" section, note that CREATE SUBSCRIPTION
uses copy_data = true (the default) to copy the initial sequence values,
and link to the copy_data parameter.
---
doc/src/sgml/logical-replication.sgml | 4 +++-
doc/src/sgml/ref/alter_subscription.sgml | 10 ++++++----
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/doc/src/sgml/logical-replication.sgml b/doc/src/sgml/logical-replication.sgml
index f21239af6b8..63935fa2eb3 100644
--- a/doc/src/sgml/logical-replication.sgml
+++ b/doc/src/sgml/logical-replication.sgml
@@ -1784,7 +1784,9 @@ Included in publications:
<listitem>
<para>
use <link linkend="sql-createsubscription"><command>CREATE SUBSCRIPTION</command></link>
- to initially synchronize the published sequences.
+ with <link linkend="sql-createsubscription-params-with-copy-data">
+ <literal>copy_data = true</literal></link> (the default) to copy the
+ initial sequence values from the publisher.
</para>
</listitem>
<listitem>
diff --git a/doc/src/sgml/ref/alter_subscription.sgml b/doc/src/sgml/ref/alter_subscription.sgml
index fad1f90956a..8d64744375a 100644
--- a/doc/src/sgml/ref/alter_subscription.sgml
+++ b/doc/src/sgml/ref/alter_subscription.sgml
@@ -237,11 +237,13 @@ ALTER SUBSCRIPTION <replaceable class="parameter">name</replaceable> RENAME TO <
<para>
Re-synchronize sequence data with the publisher. Unlike
<link linkend="sql-altersubscription-params-refresh-publication">
- <command>ALTER SUBSCRIPTION ... REFRESH PUBLICATION</command></link> which
- only has the ability to synchronize newly added sequences,
+ <command>ALTER SUBSCRIPTION ... REFRESH PUBLICATION</command></link>,
+ which synchronizes the subscription's set of sequences with the
+ publication (adding new and removing dropped sequences),
<literal>REFRESH SEQUENCES</literal> will re-synchronize the sequence
- data for all currently subscribed sequences. It does not add or remove
- sequences from the subscription to match the publication.
+ data for all currently subscribed sequences without changing which
+ sequences are subscribed. Run <literal>REFRESH PUBLICATION</literal>
+ first if the publication's set of sequences has changed.
</para>
<para>
See <xref linkend="sequence-definition-mismatches"/> for
--
2.54.0
view thread (4+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: DOCS - Clarify that REFRESH SEQUENCES might be using stale publication data
In-Reply-To: <CAA4eK1Jr-f1fhELi2XxF=u8NNBBNOPv7dQiNPFsd3twC1w98BA@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox