Re: Logical Replication of sequences

From: shveta malik <shveta(dot)malik(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: vignesh C <vignesh21(at)gmail(dot)com>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Nisha Moond <nisha(dot)moond412(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>, shveta malik <shveta(dot)malik(at)gmail(dot)com>
Subject: Re: Logical Replication of sequences
Date: 2025-07-21 10:46:00
Message-ID: CAJpy0uB0HmmiqrE5DrvH-jZPgSM7iiObGuTbg5JeOrEPT_5xPw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jul 21, 2025 at 2:55 PM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>
> On Mon, Jul 21, 2025 at 2:36 PM vignesh C <vignesh21(at)gmail(dot)com> wrote:
> >
> > On Mon, 21 Jul 2025 at 11:15, Dilip Kumar <dilipbalaut(at)gmail(dot)com> wrote:
> > >
> >
> > > 3. Some of the syntaxes works for sequence which doesn't make sense to
> > > me, as listed below, I think there are more
> > >
> > > postgres[154731]=# CREATE PUBLICATION insert_only FOR ALL SEQUENCES
> > > WITH (publish = 'insert');
> > > CREATE PUBLICATION
> > >
> > > postgres[154731]=# CREATE PUBLICATION pub FOR ALL SEQUENCES WITH (
> > > PUBLISH_VIA_PARTITION_ROOT );
> > > CREATE PUBLICATION
> >
> > There is a documentation for this at sql-createpublication.html:
> > WITH ( publication_parameter [= value] [, ... ] )
> > This clause specifies optional parameters for a publication when
> > publishing tables. This clause is not applicable for sequences.
> >
> > I felt it was enough, should we do anything more here?
> >
>
> It would be better if we can give ERROR for options that are not
> specific to sequences.
>

Alter-PUB also should give an error then. Currently it works

postgres=# alter publication pub1 set (publish='insert,update');
ALTER PUBLICATION

pub1 here is an all-sequence publication.

Also, we need to decide behaviour for a publication with 'all tables,
all sequences' having such WITH options for both CREATE and ALTER-PUB.
The options are valid for tables but not for sequences. In such a
case, giving an error might not be correct. For this particular case,
we can give a NOTICE saying options not applicable to sequences.
Thoughts?

thanks
Shveta

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message shveta malik 2025-07-21 10:52:42 Re: Skipping schema changes in publication
Previous Message Yura Sokolov 2025-07-21 10:01:26 Re: Add 64-bit XIDs into PostgreSQL 15