Re: Support EXCEPT for TABLES IN SCHEMA publications

From: vignesh C <vignesh21(at)gmail(dot)com>
To: Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Support EXCEPT for TABLES IN SCHEMA publications
Date: 2026-04-15 13:08:01
Message-ID: CALDaNm0vEdw8R1Uynmcj-JBY_-U7UtuTanbTysL03P61TNAzGg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 15 Apr 2026 at 14:22, Nisha Moond <nisha(dot)moond412(at)gmail(dot)com> wrote:
>
> On Tue, Apr 14, 2026 at 8:46 PM vignesh C <vignesh21(at)gmail(dot)com> wrote:
> >
> > When an EXCEPT table is specified together with TABLES IN SCHEMA sch1,
> > the EXCEPT entry is correctly created:
> > postgres=# create publication pub1 for tables in schema sch1 except (sch1.t1);
> > CREATE PUBLICATION
> >
> > postgres=# \dRp+ pub1
> > Publication pub1
> > Owner | All tables | All sequences | Inserts | Updates | Deletes |
> > Truncates | Generated columns | Via root | Description
> > ---------+------------+---------------+---------+---------+---------+-----------+-------------------+----------+-------------
> > vignesh | f | f | t | t | t |
> > t | none | f |
> > Tables from schemas:
> > "sch1"
> > Except tables:
> > "sch1.t1"
> > However, after dropping the schema from the publication, the
> > previously recorded EXCEPT table entry is still retained:
> > postgres=# alter publication pub1 drop TABLES IN SCHEMA sch1 ;
> > ALTER PUBLICATION
> > postgres=# \dRp+ pub1
> > Publication pub1
> > Owner | All tables | All sequences | Inserts | Updates | Deletes |
> > Truncates | Generated columns | Via root | Description
> > ---------+------------+---------------+---------+---------+---------+-----------+-------------------+----------+-------------
> > vignesh | f | f | t | t | t |
> > t | none | f |
> > Except tables:
> > "sch1.t1"
> >
> > This seems incorrect, because once sch1 is no longer part of the
> > publication, retaining "sch1.t1" as an EXCEPT entry no longer has any
> > semantic meaning and leaves behind stale catalog state.
> >
>
> This is handled in v1-003 (last) patch along with other ALTER
> PUBLICATION related modifications.

I was reviewing the patches individually and noticed this. If it is
handled in the 003 ignore that comment.

Regards,
Vignesh

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message vignesh C 2026-04-15 13:12:47 Fix tab completion after EXCEPT (...) in IMPORT FOREIGN SCHEMA
Previous Message Kirill Reshke 2026-04-15 12:45:01 Re: Add errdetail() with PID and UID about source of termination signal