Re: Logical Replication of sequences

vignesh C <vignesh21@gmail.com>

From: vignesh C <vignesh21@gmail.com>
To: Shlok Kyal <shlok.kyal.oss@gmail.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>, shveta malik <shveta.malik@gmail.com>, Shinya Kato <shinya11.kato@gmail.com>, Peter Smith <smithpb2250@gmail.com>, Chao Li <li.evan.chao@gmail.com>, Masahiko Sawada <sawada.mshk@gmail.com>, "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>, "Zhijie Hou (Fujitsu)" <houzj.fnst@fujitsu.com>, Dilip Kumar <dilipbalaut@gmail.com>, Nisha Moond <nisha.moond412@gmail.com>, Peter Eisentraut <peter@eisentraut.org>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Euler Taveira <euler@eulerto.com>, Michael Paquier <michael@paquier.xyz>, "Jonathan S. Katz" <jkatz@postgresql.org>
Date: 2025-11-11T05:46:18Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Doc: Add documentation for sequence synchronization.

  2. Remove unused assignment in CREATE PUBLICATION grammar.

  3. Add seq_sync_error_count to subscription statistics.

  4. Fix few issues in commit 5509055d69.

  5. Add sequence synchronization for logical replication.

  6. Add worker type argument to logical replication worker functions.

  7. Introduce "REFRESH SEQUENCES" for subscriptions.

  8. Refactor logical worker synchronization code into a separate file.

  9. Standardize use of REFRESH PUBLICATION in code and messages.

  10. Add "ALL SEQUENCES" support to publications.

  11. Expose sequence page LSN via pg_get_sequence_data.

  12. Resume conflict-relevant data retention automatically.

  13. Post-commit review fixes for 228c370868.

  14. Generate GUC tables from .dat file

On Tue, 11 Nov 2025 at 09:59, Shlok Kyal <shlok.kyal.oss@gmail.com> wrote:
>
> On Tue, 11 Nov 2025 at 09:02, Amit Kapila <amit.kapila16@gmail.com> wrote:
> >
> > On Mon, Nov 10, 2025 at 4:22 PM vignesh C <vignesh21@gmail.com> wrote:
> > >
> > > On Mon, 10 Nov 2025 at 14:34, Shlok Kyal <shlok.kyal.oss@gmail.com> wrote:
> > > >
> > > > While working on another thread, I found that in HEAD gram.y has
> > > > grammar which was committed as part of this thread:
> > > > ```
> > > >             | CREATE PUBLICATION name FOR pub_obj_type_list opt_definition
> > > >                 {
> > > >                     CreatePublicationStmt *n = makeNode(CreatePublicationStmt);
> > > >
> > > >                     n->pubname = $3;
> > > >                     n->pubobjects = (List *) $5;
> > > >                     preprocess_pub_all_objtype_list($5, &n->for_all_tables,
> > > >                                                     &n->for_all_sequences,
> > > >                                                     yyscanner);
> > > >                     n->options = $6;
> > > >                     $$ = (Node *) n;
> > > >                 }
> > > > ```
> > > >
> > > > Here we are assigning "n->pubobjects = (List *) $5". But later in the
> > > > code this is not used anywhere for ALL TABLES/ ALL SEQUENCES
> > > > publication. It is used for other publications (not ALL TABLES/
> > > > SEQUENCES) inside function "ObjectsInPublicationToOids"
> > > >
> > > > So are we required to assign "n->pubobjects" here?
> > > >
> > > > I have created a patch to remove this assignment. It passed "make check-world".
> > >
> > > I agree that this is not required for ALL TABLES/ALL SEQUENCES cases.
> > >
> >
> > I also agree. BTW, can we change pub_obj_type_list to
> > pub_all_obj_type_list to be more explicit about this variant? If you
> > agree then we can make similar changes
> > (pub_obj_type->pub_all_obj_type) at the following places as well:
> >
> > + * CREATE PUBLICATION FOR ALL pub_obj_type [, ...] [WITH options]
> > + *
> > + * pub_obj_type is one of:
> > + *
> >
> Hi Vignesh, Amit
>
> Thanks for confirming.
> Also, I agree that the name 'pub_all_obj_type' will be more suitable.
> I have updated the patch for the same.

Thanks, this version looks good to me, I don't have any comments.

Regards,
Vignesh