Re: Support EXCEPT for TABLES IN SCHEMA publications

From: Peter Smith <smithpb2250(at)gmail(dot)com>
To: shveta malik <shveta(dot)malik(at)gmail(dot)com>
Cc: Nisha Moond <nisha(dot)moond412(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-17 06:56:49
Message-ID: CAHut+Psqq=NT=bhuKtqTU+0esbk2cxhxPYp3jjn3KTR+L4wc9w@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jul 16, 2026 at 8:32 PM shveta malik <shveta(dot)malik(at)gmail(dot)com> wrote:
...
> 4)
> postgres=# create publication pub1 for tables in schema s2 except
> (table s2.tab_root), table s2.tab_part_2, table s2.tab_part_1_p2;
> ERROR: partition "s2.tab_part_2" cannot be both published and excluded
> DETAIL: Ancestor "s2.tab_root" of partition "s2.tab_part_2" is
> currently listed in the EXCEPT clause of this command.
>
> postgres=# ALTER publication pub1 add TABLE s2.tab_part_1_p2;
> ERROR: cannot add partition "s2.tab_part_1_p2" to publication "pub1"
> DETAIL: Ancestor "s2.tab_root" of partition "s2.tab_part_1_p2" is
> currently listed in the EXCEPT clause of the publication.
> HINT: Change EXCEPT list using ALTER PUBLICATION ... SET TABLES IN
> SCHEMA ... EXCEPT.
>
>
> Should the DETAIL be just:
> DETAIL: Partition root "s2.tab_root" is listed in the publication's
> EXCEPT clause.
>
> Thoughts?

After some offline discussion, we've landed on the following consensus
for this errdetail replacement:

DETAIL: Partition root "s2.tab_root" is named in the publication's
EXCEPT clause for schema "s2"

- The earlier message wrongly implied that a publication can have only
1 EXCEPT clause
- This new one explicitly identifies exactly which EXCEPT clause is involved
- IIUC, this particular message is never used by the ALL TABLES EXCEPT
logic, so naming the schema should be fine

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message solai v 2026-07-17 06:57:03 Re: pg_xmin_horizon: a system view of everything pinning the xmin horizon
Previous Message Ian Lawrence Barwick 2026-07-17 06:49:55 Re: Remove getpgusername()