Re: Skipping schema changes in publication
shveta malik <shveta.malik@gmail.com>
From: shveta malik <shveta.malik@gmail.com>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Amit Kapila <amit.kapila16@gmail.com>, vignesh C <vignesh21@gmail.com>, Shlok Kyal <shlok.kyal.oss@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>, Nisha Moond <nisha.moond412@gmail.com>, shveta malik <shveta.malik@gmail.com>
Date: 2026-03-02T10:18:14Z
Lists: pgsql-hackers
All, Currently, the syntax we plan to support in patch001 is: CREATE PUBLICATION pub for ALL TABLES EXCEPT TABLE (tab1, tab2, ...) That is: a) The TABLE keyword is mandatory after EXCEPT. b) Parentheses around the table list are mandatory. There has been some confusion regarding the EXCEPT syntax. Below are the points that help justify the above syntax. 1) TABLE keyword: Consider the command: CREATE PUBLICATION pub1 FOR ALL TABLES EXCEPT (tab1, tab2); At first glance, this appears acceptable even without the TABLE keyword after EXCEPT. However, in the future, if we support excluding a particular schema, for example: CREATE PUBLICATION pub1 FOR ALL TABLES EXCEPT SCHEMA s1, s2; then it becomes necessary to explicitly specify whether we are excluding a TABLE, SCHEMA, or SEQUENCE after EXCEPT. Similarly, if we extend CREATE PUBLICATION to support something like: CREATE PUBLICATION pub FOR TABLES, SEQUENCES IN SCHEMA sch1 EXCEPT TABLE (t1), EXCEPT SEQUENCE (s1); then also, the TABLE or SEQUENCE keyword after EXCEPT becomes mandatory for clarity. 2) Parentheses: Currently, we do not use parentheses around table names in commands such as: CREATE PUBLICATION pub1 FOR TABLE tab1, tab2; So it may seem acceptable to allow: CREATE PUBLICATION pub1 FOR ALL TABLES EXCEPT tab1, tab2; However, if we later support syntax like: CREATE PUBLICATION pub FOR TABLES IN SCHEMA s1 EXCEPT TABLE t; the future syntax for pub with tables-in-schema with EXCEPT and a regular table-inclusion might look like: CREATE PUBLICATION pub FOR TABLES IN SCHEMA s1 EXCEPT TABLE (t1, t2), TABLE t3; This is much clearer than a version without parentheses: CREATE PUBLICATION pub FOR TABLES IN SCHEMA s1 EXCEPT TABLE t1, t2, TABLE t3; In the first version, it is clearly understood that t1 and t2 are excluded, while t3 is included. Without parentheses, the intent becomes ambiguous. Therefore, making both the TABLE keyword and parentheses mandatory after EXCEPT ensures clarity and extensibility for future enhancements. ~~ So we will proceed with this syntax unless there are any objections. thanks Shveta
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