Re: Review items for EXCEPT TABLE publication

From: Peter Smith <smithpb2250(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: vignesh C <vignesh21(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Review items for EXCEPT TABLE publication
Date: 2026-09-11 06:29:40
Message-ID: CAHut+PunLReA86mPmi7Wr1-Hd_TnhtM1+Ko8Bc6HhBz1LRjQNg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Sep 11, 2026 at 3:51 PM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>
> On Thu, Sep 10, 2026 at 11:09 AM vignesh C <vignesh21(at)gmail(dot)com> wrote:
> >
> > Finding #5: SET UNLOGGED on an excluded table produces an unrestorable
> > catalog state
> >
>
> + if (!toLogged &&
> + GetRelationExcludedPublications(RelationGetRelid(rel)) != NIL)
> + ereport(ERROR,
> + (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
> + errmsg("cannot change table \"%s\" to unlogged because i
>
> Can we have one unified function to check whether a table is part of
> any publication and get an additional out parameter whether that is an
> include or exclude table? As we can't have the same table both
> included and excluded, this should work unless I am missing something.
>

I did not understand "we can't have the same table both included and excluded".

What about:

test_pub=# CREATE PUBLICATION pub1 FOR ALL TABLES EXCEPT (TABLE t1);
CREATE PUBLICATION

test_pub=# CREATE PUBLICATION pub2 FOR TABLE t1;
CREATE PUBLICATION

test_pub=# select * from pg_publication_rel;
oid | prpubid | prrelid | prexcept | prqual | prattrs
-------+---------+---------+----------+--------+---------
16392 | 16391 | 16387 | t | |
16394 | 16393 | 16387 | f | |
(2 rows)

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message vignesh C 2026-09-11 06:33:50 Re: Review items for EXCEPT TABLE publication
Previous Message Andrey Borodin 2026-09-11 06:29:00 Re: CI slowdown due to PG_TEST_INITDB_EXTRA_OPTS