Re: Support EXCEPT for TABLES IN SCHEMA publications

From: Peter Smith <smithpb2250(at)gmail(dot)com>
To: Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>
Cc: shveta malik <shveta(dot)malik(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Support EXCEPT for TABLES IN SCHEMA publications
Date: 2026-07-31 08:44:13
Message-ID: CAHut+Pumod7UW71WHO0GMA2qibG+TTsX7j5FJykAJgBwR73EdA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

A couple of comments for v24-0001

======
Commit message.

1.
Extend table exclusion support in publications to allow specific
tables to be excluded from schema-level publications using an
EXCEPT clause in CREATE PUBLICATION.

Supported syntax:
CREATE PUBLICATION <pub> FOR TABLES IN SCHEMA s EXCEPT (TABLE t1,...);

~

1a.
Change /<pub>/pub/

~

1b.
Now that you are combining more patches, this commit message seemed a
bit light on details.

You might say include things like:

NOTES
- Conflicting or redundant EXCEPT clauses are not allowed
- EXCEPT clause tables must come from the associate schema
- psql describe commands are updated handle tables excluded from schemas
- Excluding partitions in not allowed
- Excluding a partition root excludes the entire partition tree, even
tables in different schemas
- etc.

======
src/backend/utils/cache/relcache.c

RelationBuildPublicationDesc:

1.
+ /* Drop the publications that exclude this relation. */
+ if (exceptpuboids != NIL)
+ puboids = list_difference_oid(puboids, exceptpuboids);
+

AFAIK, there is no DROP PUBLICATION in this logic.

Instead of "Drop", how about "Ignore" or "Skip" to remove any ambiguity.

======
Kind Regards,
Peter Smith.
Fujitsu Australia

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Anthonin Bonnefoy 2026-07-31 09:00:54 Add PQTRACE env to enable protocol tracing in libpq
Previous Message Amit Kapila 2026-07-31 08:42:18 Re: CREATE SUBSCRIPTION ... SERVER vs. pg_dump, etc.