Re: Logical Replication of sequences
Nisha Moond <nisha.moond412@gmail.com>
From: Nisha Moond <nisha.moond412@gmail.com>
To: shveta malik <shveta.malik@gmail.com>
Cc: Shlok Kyal <shlok.kyal.oss@gmail.com>, vignesh C <vignesh21@gmail.com>, Amit Kapila <amit.kapila16@gmail.com>, Peter Smith <smithpb2250@gmail.com>, "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>,
Masahiko Sawada <sawada.mshk@gmail.com>, Peter Eisentraut <peter@eisentraut.org>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>,
Euler Taveira <euler@eulerto.com>, Michael Paquier <michael@paquier.xyz>,
"Zhijie Hou (Fujitsu)" <houzj.fnst@fujitsu.com>, "Jonathan S. Katz" <jkatz@postgresql.org>
Date: 2025-06-30T09:51:48Z
Lists: pgsql-hackers
On Wed, Jun 25, 2025 at 9:26 AM shveta malik <shveta.malik@gmail.com> wrote: > > On Tue, Jun 24, 2025 at 6:44 PM Shlok Kyal <shlok.kyal.oss@gmail.com> wrote: > > > > > > 1. Initially, I have created a publication on sequence s1. > > postgres=# CREATE PUBLICATION pub1 FOR ALL SEQUENCES; > > CREATE PUBLICATION > > postgres=# ALTER PUBLICATION pub1 SET TABLE t1; > > ALTER PUBLICATION > > postgres=# \d s1 > > Sequence "public.s1" > > Type | Start | Minimum | Maximum | Increment | Cycles? | Cache > > --------+-------+---------+---------------------+-----------+---------+------- > > bigint | 1 | 1 | 9223372036854775807 | 1 | no | 1 > > Publications: > > "pub1" > > postgres=# select * from pg_publication_rel; > > oid | prpubid | prrelid | prqual | prattrs > > -------+---------+---------+--------+--------- > > 16415 | 16414 | 16388 | | > > (1 row) > > > > Here, we can set the publication to TABLE or TABLES FOR SCHEMA. Should > > this be allowed? > > If a publication is created on FOR ALL TABLES, such an operation is not allowed. > > > > Good catch. IMO, this should not be allowed as currently we strictly > support either ALL SEQUENCES or ALL SEQUENCES with ALL TABLES alone. > +1 A similar situation existed for the ALTER PUBLICATION ... ADD ... command as reported in [1] (point #3). This has been addressed in v20250630, where similar to ALL TABLES, ADD or SET operations are now disallowed for ALL SEQUENCES publications. [1] https://www.postgresql.org/message-id/CABdArM7h1qQLUb_S7i6MrLPEtHXnX%2BY2fPQaSnqhCdHktcQk5Q%40mail.gmail.com -- Thanks, Nisha