Re: Skipping schema changes in publication
Amit Kapila <amit.kapila16@gmail.com>
From: Amit Kapila <amit.kapila16@gmail.com>
To: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: 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>, Peter Smith <smithpb2250@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-13T10:00:05Z
Lists: pgsql-hackers
On Wed, Mar 11, 2026 at 11:24 PM Masahiko Sawada <sawada.mshk@gmail.com> wrote: > > > > > 2. Parentheses around the exclusion list > > > > Parentheses are required to clearly separate the excluded objects from > > other elements in the publication definition, especially when mixed > > with inclusion clauses. For example, consider a future case like: > > > > CREATE PUBLICATION pub > > FOR TABLES IN SCHEMA s1 > > EXCEPT TABLE (t1, t2), TABLE t3; > > > > Here it is clear that t1 and t2 are excluded, while t3 is explicitly > > included. Without parentheses, a statement like: > > > > CREATE PUBLICATION pub > > FOR TABLES IN SCHEMA s1 > > EXCEPT TABLE t1, t2, TABLE t3; > > > > would be harder to interpret and potentially ambiguous. > > > > So although the syntax differs slightly from the existing inclusion > > list (e.g., TABLE a, b), requiring both the TABLE keyword and > > parentheses after EXCEPT helps keep the grammar unambiguous and makes > > the syntax easier to extend in the future. > > I'm still unsure that the syntax like TABLE (t1, t2) for the exclusion > list is syntactically correct. The syntax of TABLE (...) is already > used in a quite different way as follows (borrowed an example from > stats_import.sql): > > CREATE FUNCTION stats_import.pg_statistic_get_difference(a text, b text) > RETURNS TABLE (relname text, stats stats_import.pg_statistic_flat_t) > Both are different usage and not clear if they are comparable. > > Wouldn't it be more appropriate to use a plural form or the IN > keyword, such as EXCEPT TABLES (t1, t2) or EXCEPT TABLES IN (t1, t2)? > We can consider it. Let's try to compare it with following existing publication syntax: CREATE PUBLICATION production_publication FOR TABLE users, departments, TABLES IN SCHEMA production; CREATE PUBLICATION alltables FOR ALL TABLES; Here we used singular form when a user could specify one or more objects and plural when all objects of schema or database are considered. As per this, the except syntax falls in the singular category which is in favor of current syntax. -- 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 →
-
Fix miscellaneous issues in EXCEPT publication clause.
- 6b0550c45d13 19 (unreleased) landed
-
Change syntax of EXCEPT TABLE clause in publication commands.
- 5984ea868eee 19 (unreleased) landed
-
Add support for EXCEPT TABLE in ALTER PUBLICATION.
- 493f8c6439cf 19 (unreleased) landed
-
Allow table exclusions in publications via EXCEPT TABLE.
- fd366065e06a 19 (unreleased) landed
-
Add wait_for_subscription_sync for TAP tests.
- 0c20dd33db16 16.0 cited