Re: Skipping schema changes in publication

Amit Kapila <amit.kapila16@gmail.com>

From: Amit Kapila <amit.kapila16@gmail.com>
To: Peter Smith <smithpb2250@gmail.com>
Cc: Masahiko Sawada <sawada.mshk@gmail.com>, "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>, shveta malik <shveta.malik@gmail.com>, vignesh C <vignesh21@gmail.com>, Shlok Kyal <shlok.kyal.oss@gmail.com>, Nisha Moond <nisha.moond412@gmail.com>, Ashutosh Sharma <ashu.coek88@gmail.com>, "David G. Johnston" <david.g.johnston@gmail.com>, Dilip Kumar <dilipbalaut@gmail.com>, "Zhijie Hou (Fujitsu)" <houzj.fnst@fujitsu.com>, YeXiu <1518981153@qq.com>, Ian Lawrence Barwick <barwick@gmail.com>, Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2026-03-13T09:51:34Z
Lists: pgsql-hackers
On Fri, Mar 13, 2026 at 8:55 AM Peter Smith <smithpb2250@gmail.com> wrote:
>
> Hou-San (off-list) gave an interesting example of how it might look
> when the example is combined with the hypothetical future ability to
> exclude all schema tables from a "FOR ALL TABLES"
> CREATE PUBLICATION pub FOR ALL TABLES EXCEPT (TABLE t1, t2, TABLES IN
> SCHEMA s1);
>

So, if we follow this, in future, the syntax would look like:
Create publication pub1 FOR ALL TABLES EXCEPT (TABLE t1, t2, TABLES IN
SCHEMA s1, s2), ALL SEQUENCES EXCEPT (SEQUENCE s1);

I think if we use the above syntax then one can also argue that why
not use FOR ALL (TABLES, SEQUENCES) instead of ALL TABLES, ALL
SEQUENCES.

Instead the current command would like:
Create publication pub1 FOR ALL TABLES EXCEPT TABLE (t1, t2), EXCEPT
TABLES IN SCHEMA (s1, s2), ALL SEQUENCES EXCEPT SEQUENCE (seq1, seq2);

Though it is slightly lengthy it makes the syntax local such that the
meaning of a clause is determined by what is inside it, not by
something that appears ten words later.

-- 
With Regards,
Amit Kapila.



Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Fix miscellaneous issues in EXCEPT publication clause.

  2. Change syntax of EXCEPT TABLE clause in publication commands.

  3. Add support for EXCEPT TABLE in ALTER PUBLICATION.

  4. Allow table exclusions in publications via EXCEPT TABLE.

  5. Add wait_for_subscription_sync for TAP tests.