Re: Support EXCEPT for TABLES IN SCHEMA publications

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: shveta malik <shveta(dot)malik(at)gmail(dot)com>
Cc: Peter Smith <smithpb2250(at)gmail(dot)com>, Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>, vignesh C <vignesh21(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-25 06:38:10
Message-ID: CAA4eK1J_i_1+82sWxVrRFpXXzvKBnuDfU22SmfQ6PBsNaQw1Wg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Aug 24, 2026 at 3:25 PM shveta malik <shveta(dot)malik(at)gmail(dot)com> wrote:
>
> Partition Case Rules:
> -----------------------------------
> a) By default, mentioning a 'partition root 'means that its entire
> partition tree is included/excluded, irrespective of schema
> boundaries, consistent with HEAD.
> b) An explicitly mentioned partition is allowed and takes precedence
> over the partition-tree exclusion.
>
> Going through the cases again:
> 1. FOR TABLES IN SCHEMA s1 EXCEPT (s1.root), TABLES IN SCHEMA s2;
> Excludes root: By default all its parition gets excluded, even the
> ones present in s2.
>
> 2. FOR TABLES IN SCHEMA s1 EXCEPT (s1.root), FOR TABLE s1.p1;
> Excludes s1.root: By default all its partitions get excluded except
> s1.p1. s1.p1 is still published as the user has explicitly mentioned
> it.
>

Both the above cases seem to fall in the same category though for the
first one the table is not explicitly mentioned but TABLES IN SCHEMA
does mean all tables in that schema. The another point I see in making
both above cases behave similar (follow what you mentioned in 2) is
that we will follow the same behavior when two different publications
(pub1 FOR TABLES IN SCHEMA s1 EXCEPT (s1.root) and pub2 FOR TABLES IN
SCHEMA s2;) that specify the two clauses separately are combined by
SUBSCRIPTION.

--
With Regards,
Amit Kapila.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Maksim.Melnikov 2026-08-25 06:45:17 Re: Init connection time grows quadratically
Previous Message Peter Eisentraut 2026-08-25 06:37:04 relpages value for partitioned tables