Re: Support EXCEPT for TABLES IN SCHEMA publications

From: Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>
To: Peter Smith <smithpb2250(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-08-04 08:42:00
Message-ID: CABdArM6RwzkT-e53y6XYH2N17VeDU+tU+LO9iGsC8jqf_fnT-w@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jul 31, 2026 at 2:14 PM Peter Smith <smithpb2250(at)gmail(dot)com> wrote:
>
> 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.
>

Update the commit message for patch 001 with more details.

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

Updated.

--
Thanks,
Nisha

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2026-08-04 09:06:56 Re: Implicit conversion from int64 to int32 when calling hash_get_num_entries
Previous Message Nisha Moond 2026-08-04 08:41:48 Re: Support EXCEPT for TABLES IN SCHEMA publications