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. 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
