Re: Support EXCEPT for TABLES IN SCHEMA publications

From: Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: shveta malik <shveta(dot)malik(at)gmail(dot)com>, Peter Smith <smithpb2250(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-03 16:45:14
Message-ID: CABdArM4-qUkbrpjVMOqjq3TJqddzBhWDJQsATyZHHaMTp-MdEA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jul 2, 2026 at 2:34 PM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>
> On Wed, Jul 1, 2026 at 3:54 PM shveta malik <shveta(dot)malik(at)gmail(dot)com> wrote:
> >
> > On Wed, Jul 1, 2026 at 3:42 PM Nisha Moond <nisha(dot)moond412(at)gmail(dot)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.
> >
>
> +1. It is good to be consistent here with similar ALL TABLES case.
> BTW, as we can't exclude the child table explicitly, this anyway seems
> like the only option because otherwise, users won't have any way to
> exclude the child table.
>

I've updated the related comments in v18 and also updated the CREATE
PUBLICATION docs to clarify this behavior.

--
Thanks,
Nisha

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Imran Zaheer 2026-07-03 17:23:38 Re: Path Traversal Vulnerability in pg_dump Directory Format
Previous Message Nisha Moond 2026-07-03 16:45:03 Re: Support EXCEPT for TABLES IN SCHEMA publications