Re: Support EXCEPT for TABLES IN SCHEMA publications
shveta malik <shveta.malik@gmail.com>
From: shveta malik <shveta.malik@gmail.com>
To: Nisha Moond <nisha.moond412@gmail.com>
Cc: Peter Smith <smithpb2250@gmail.com>,
Amit Kapila <amit.kapila16@gmail.com>, Zsolt Parragi <zsolt.parragi@percona.com>,
pgsql-hackers@lists.postgresql.org, shveta malik <shveta.malik@gmail.com>
Date: 2026-07-01T10:24:19Z
Lists: pgsql-hackers
On Wed, Jul 1, 2026 at 3:42 PM Nisha Moond <nisha.moond412@gmail.com> wrote: > > During tests, I found one behavior that needs discussion: > > Consider a partition hierarchy where the root table is in schema s2, a > child partition is in schema s1, and the publication includes both > schemas but excludes only the root table. This is the exact scenario I had in mind when reviewing 'get_rel_sync_entry-->GetTopMostAncestorInPublication' flow, thus I suggested adding comments about intentionally fetching the 'Exclude list' only for the Root. I was about to test it in my next review cycle. The first thought is that if root is excluded, the partition should also be excluded to maintain consistency with the 'ALL TABLES Except ROOT' behaviour. But then it needs to be documented too. This is my initial understanding, but I will think more when I resume the review. > Test case: > -- Root of the partition tree lives in s2 > CREATE TABLE s2.parent (id int) PARTITION BY LIST (id); > > -- Child partition lives in s1 > CREATE TABLE s1.part PARTITION OF s2.parent FOR VALUES IN (1, 2, 3); > > -- Publication covers BOTH schemas, but EXCEPTs only s2.parent > CREATE PUBLICATION p FOR TABLES IN SCHEMA s1, TABLES IN SCHEMA s2 > EXCEPT (TABLE s2.parent); > > Currently, if the root is excluded, all child partitions are also > excluded, meaning s1.part is not published. However, s1 never excluded > 'part' explicitly, so the behavior may not be intuitive. > > We need to decide whether child partitions should always remain > excluded when the root is excluded (regardless of schema), or whether > schema membership should still allow publication. > > I've added an XXX comment in pg_publication.c to track this until we > conclude on the expected behavior. Suggestions are welcome. > > -- > Thanks, > Nisha
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Doc: Clarify that publication exclusions track table identity.
- 77b6dd909252 19 (unreleased) cited