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

From shveta malik
Subject Re: Logical Replication of sequences
Date
Msg-id CAJpy0uCgADMz6BN7WdOcALtUN+8rwdAfoRFJeh0wrvkOdxOXrQ@mail.gmail.com
Whole thread Raw
In response to Re: Logical Replication of sequences  (Peter Smith <smithpb2250@gmail.com>)
List pgsql-hackers
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.

thanks
Shveta



pgsql-hackers by date:

Previous
From: Nisha Moond
Date:
Subject: Re: Logical Replication of sequences
Next
From: "Zhijie Hou (Fujitsu)"
Date:
Subject: RE: Slot's restart_lsn may point to removed WAL segment after hard restart unexpectedly