Re: Support EXCEPT for ALL SEQUENCES publications

From: vignesh C <vignesh21(at)gmail(dot)com>
To: Shlok Kyal <shlok(dot)kyal(dot)oss(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Support EXCEPT for ALL SEQUENCES publications
Date: 2026-04-10 06:29:23
Message-ID: CALDaNm2DysPZD+5uJvygkws9i+7Q3EvUdofEmYguvfnod_ZDnQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 10 Apr 2026 at 11:39, Shlok Kyal <shlok(dot)kyal(dot)oss(at)gmail(dot)com> wrote:
>
> Hi hackers,
>
> Thread [1] introduced support for the EXCEPT clause for publications
> defined with ALL TABLES. To extend this functionality, as discussed in
> [2], this patch series adds support for the EXCEPT clause for
> publications defined with ALL SEQUENCES.
>
> The series consists of the following patches:
>
> 0001: Support EXCEPT for ALL SEQUENCES in CREATE PUBLICATION
> This allows excluding specific sequences when using CREATE PUBLICATION
> ... FOR ALL SEQUENCES.
> Example:
> CREATE PUBLICATION pub1 FOR ALL SEQUENCES EXCEPT (SEQUENCE s1, s2);
>
> 0002: Support EXCEPT for ALL SEQUENCES in ALTER PUBLICATION
> This extends ALTER PUBLICATION to manage exclusions for ALL SEQUENCES.
> Examples:
> ALTER PUBLICATION pub1 SET ALL SEQUENCES;
> This clears any existing sequence exclusions.
>
> ALTER PUBLICATION pub1 SET ALL SEQUENCES EXCEPT (SEQUENCE s1, s2);
> This replaces the exclusion list with the specified sequences.
>
> Sequences listed in the EXCEPT clause are excluded from the
> publication and are not replicated to the subscriber.

+1 for this feature.

Currently, FOR ALL SEQUENCES is effectively an all-or-nothing choice.
In practice, there are often specific sequences, such as temporary or
locally managed ones, that do not need to be replicated. With this
change, those can now be excluded cleanly.

Regards,
Vignesh

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2026-04-10 06:33:30 Re: Trying out libarchive for reading user-generated WAL tarballs
Previous Message Chao Li 2026-04-10 06:18:10 Re: Add errdetail() with PID and UID about source of termination signal