Re: Include sequences in publications created by pg_createsubscriber - Mailing list pgsql-hackers

From vignesh C
Subject Re: Include sequences in publications created by pg_createsubscriber
Date
Msg-id CALDaNm3Kh83ufGbgJqc8Frn=UvqC3LAd43eKS=FRuEWaRxbp4w@mail.gmail.com
Whole thread
Responses Re: Include sequences in publications created by pg_createsubscriber
List pgsql-hackers
On Fri, 26 Jun 2026 at 03:50, Peter Smith <smithpb2250@gmail.com> wrote:
>
> Some review comments for v3.
>
> ======
> doc/src/sgml/ref/pg_createsubscriber.sgml
>
> 1.
>    <para>
>     <application>pg_createsubscriber</application> creates a new logical
>     replica from a physical standby server.  All tables in the specified
> -   database are included in the <link linkend="logical-replication">logical
> -   replication</link> setup.  A pair of
> -   publication and subscription objects are created for each database.  It
> -   must be run at the target server.
> +   database are included in the
> +   <link linkend="logical-replication">logical replication</link> setup. The
> +   publications created by <application>pg_createsubscriber</application> also
> +   include all sequences, allowing their state to be synchronized after the
> +   upgrade. A pair of publication and subscription objects are created for each
> +   database. It must be run at the target server.
>    </para>
>
> This is not properly distinguishing between the internal publications
> versus user-nominated publications. I think it needs to clarify
> up-front that all of this "Description" part is really only talking
> about the (default) behaviour of using the *internally* generated FOR
> ALL TABLES, ALL SEQUENCE publications.
>
> e.g. "All tables in the specified database are included" ... that
> might not be true for user pubs.
> e.g. "A pair of publication and subscription objects are created" ...
> not for user pubs; they already exist.
>
> ~~~
>
> 2.
>     replication setup and <application>pg_createsubscriber</application> is how
>     the data synchronization is done.
> <application>pg_createsubscriber</application>
>     does not copy the initial table data. It does only the
> synchronization phase,
> -   which ensures each table is brought up to a synchronized state.
> +   which ensures each table is brought up to a synchronized state. The
> +   subscriptions are configured to include sequences, but sequence values are
> +   not synchronized automatically.
>
> Similar here.
>
> "The subscriptions are configured to include sequences" may not be
> true for the case of user-specified pubs. Also, (from my previous
> review), subscriptions are not really "configured" to include
> sequences -- if they subscribe to sequences, that is only because
> their associated publication is publishing sequences.
>

Thanks for the comments, here is an updated version with the fixes for the same.

Regards,
Vignesh

Attachment

pgsql-hackers by date:

Previous
From: jian he
Date:
Subject: Re: implement CAST(expr AS type FORMAT 'template')
Next
From: shveta malik
Date:
Subject: Re: Proposal: Conflict log history table for Logical Replication