Re: Logical Replication of sequences

From: Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: vignesh C <vignesh21(at)gmail(dot)com>, shveta malik <shveta(dot)malik(at)gmail(dot)com>, Peter Smith <smithpb2250(at)gmail(dot)com>, "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Shlok Kyal <shlok(dot)kyal(dot)oss(at)gmail(dot)com>, Peter Eisentraut <peter(at)eisentraut(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Euler Taveira <euler(at)eulerto(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>, "Jonathan S(dot) Katz" <jkatz(at)postgresql(dot)org>
Subject: Re: Logical Replication of sequences
Date: 2025-06-10 03:15:38
Message-ID: CABdArM52CSDuYsfTAEp4ZSWe+GFBvxgnPFgkG+id9T88DUE+1Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jun 3, 2025 at 5:11 PM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>
> On Thu, May 29, 2025 at 8:09 PM vignesh C <vignesh21(at)gmail(dot)com> wrote:
> >
> > These comments are handled in the attached v2025029 version patch.
> >
>
> 1. The current syntax to publish sequences is:
> CREATE PUBLICATION pub1 FOR ALL TABLES, ALL SEQUENCES;
>
> The other alternative could be:
> CREATE PUBLICATION pub1 FOR ALL TABLES, SEQUENCES;
>
> I think the syntax proposed by the patch is better because of the
> following reasons: (a) The use of ALL before both objects makes the
> intent explicit and symmetrical. (b) As we are planning to support FOR
> TABLE t1, SEQUENCE s1, so ALL SEQUENCES fit naturally as a counterpart
> to ALL TABLES.
>
> Please let me know if anyone thinks otherwise.

+1

>
> 6. ALTER SUBSCRIPTION ... REFRESH PUBLICATION SEQUENCES
>
> Can we move the implementation of the above command to a separate
> patch? This is to make 0004 shorter and easier to review.
>

Splitted patch-0004 as follows:
- patch-0004: Implements the new REFRESH PUBLICATION SEQUENCES command.
- patch-0005: Implementation of the sequencesync worker.

Attached patches address feedback from Amit [1] and Shveta [2].

[1] https://www.postgresql.org/message-id/CAJpy0uD00JCsgDxL3YjdPQFSnV4mv4D9XPZV_9%3DaMNDLao7SQQ%40mail.gmail.com
[2] https://www.postgresql.org/message-id/CAA4eK1%2B6L%2BAoGS3LHdnYnCE%3DnRHergSQyhyO7Y%3D-sOp7isGVMw%40mail.gmail.com

--
Thanks,
Nisha

Attachment Content-Type Size
v20250610-0001-Introduce-pg_sequence_state-function-for-e.patch application/x-patch 7.3 KB
v20250610-0002-Introduce-ALL-SEQUENCES-support-for-Postgr.patch application/x-patch 101.8 KB
v20250610-0003-Reorganize-tablesync-Code-and-Introduce-sy.patch application/x-patch 23.0 KB
v20250610-0004-Introduce-REFRESH-PUBLICATION-SEQUENCES-fo.patch application/x-patch 40.1 KB
v20250610-0005-New-worker-for-sequence-synchronization-du.patch application/x-patch 72.2 KB
v20250610-0006-Documentation-for-sequence-synchronization.patch application/x-patch 33.3 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2025-06-10 04:40:42 Re: Sanding down some edge cases for PL/pgSQL reserved words
Previous Message Yugo Nagata 2025-06-10 02:59:54 Re: Improve tab completion for COPY