Re: Logical Replication of sequences - Mailing list pgsql-hackers

From vignesh C
Subject Re: Logical Replication of sequences
Date
Msg-id CALDaNm0=1MnWJwWqOKSeirKyM4NSo7DrHjPQRPg+=7Pub0JZkQ@mail.gmail.com
Whole thread Raw
In response to Re: Logical Replication of sequences  (shveta malik <shveta.malik@gmail.com>)
List pgsql-hackers
On Wed, 9 Jul 2025 at 14:12, shveta malik <shveta.malik@gmail.com> wrote:
>
> Please find a few more comments on July4 patch
>
> 6)
> +  <para>
> +   To synchronize sequences from a publisher to a subscriber, first publish
> +   them using <link linkend="sql-createpublication-params-for-all-sequences">
> +   <command>CREATE PUBLICATION ... FOR ALL SEQUENCES</command></link>.
> +  </para>
>
> This sentence looks odd, as we have 'first' but no follow-up sentence
> after that. Can we please combine this line with the next one in the
> doc saying:
>
> To synchronize sequences from a publisher to a subscriber, first
> publish them using CREATE PUBLICATION ... FOR ALL SEQUENCES and then
> at the subscriber side:

Modified

> 7)
>
> +         <para>
> +          This parameter is not applicable for sequences.
> +         </para>
>
> It is mentioned 3 times in doc for publish, publish_generated_columns
> and publish_via_partition_root. Instead shall we mention it once for
> WITH-clause itself. Something like:
>
> This clause specifies optional parameters for a publication when
> publishing tables. This clause is not applicable for sequences.

Modified

> 8)
> +   The view <structname>pg_publication_sequences</structname> provides
> +   information about the mapping between publications and information of
> +   sequences they contain.
>
> Why not:
> "The view pg_publication_sequences provides information about the
> mapping between publications and sequences."
>
> I think the existing detail has been written similar to
> 'pg_publication_tables' doc. But there, 'information of tables' made
> sense as pg_publication_tables has attnames and rowfilters  too. But
> pg_publication_sequences OTOH just has
> the mapping between names. No other information.

Modified

> 9)
> +  <sect2 id="sequence-definition-mismatches">
> +   <title>Sequence Definition Mismatches</title>
> +   <warning>
> +    <para>
> +     During sequence synchronization, the sequence definitions of the publisher
> +     and the subscriber are compared.
>
> Now in code, we give WARNING for missing sequences on publisher as
> well. Do we need to mention that here? IIUC, this WARNING for missing
> sequences can come only if the worker is respawned to sync
> unmatched/failed sequences and meanwhile any one of failed sequences
> is dropped on publisher. But it will be good to mention it briefly in
> doc.

Modified

Also the comment from [1] is handled.
The attached v20250711 version patch has the changes for the same.

[1] - https://www.postgresql.org/message-id/CABdArM640YF7MQfMVhEX%3De1pJdrnVcCwS_y4XXsbvah%3D6P9S%3DA%40mail.gmail.com

Regards,
Vignesh

Attachment

pgsql-hackers by date:

Previous
From: Bertrand Drouvot
Date:
Subject: Re: Improve LWLock tranche name visibility across backends
Next
From: wenhui qiu
Date:
Subject: Re: Small optimization with expanding dynamic hash table