public inbox for [email protected]
help / color / mirror / Atom feedFrom: Amit Kapila <[email protected]>
To: Zhijie Hou (Fujitsu) <[email protected]>
Cc: shveta malik <[email protected]>
Cc: vignesh C <[email protected]>
Cc: Peter Smith <[email protected]>
Cc: Shlok Kyal <[email protected]>
Cc: Dilip Kumar <[email protected]>
Cc: Masahiko Sawada <[email protected]>
Cc: Hayato Kuroda (Fujitsu) <[email protected]>
Cc: Nisha Moond <[email protected]>
Cc: Ashutosh Sharma <[email protected]>
Cc: David G. Johnston <[email protected]>
Cc: YeXiu <[email protected]>
Cc: Ian Lawrence Barwick <[email protected]>
Cc: Bharath Rupireddy <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: Skipping schema changes in publication
Date: Wed, 22 Apr 2026 17:02:01 +0530
Message-ID: <CAA4eK1LvFapjAoDuFmpNi3yjiydk_K5d_QHK=gbiDJNqJOU=2A@mail.gmail.com> (raw)
In-Reply-To: <TYRPR01MB1419559BE4B38E6EF24EF84BA942D2@TYRPR01MB14195.jpnprd01.prod.outlook.com>
References: <CALDaNm2VghC-CSyS6jwyMMcpwSWjQ09t9AkkL0Sz7dsb1VGF3A@mail.gmail.com>
<CAJpy0uAX90WXUY4LDJfmKs4bWPn-OzFYi6grXJYh-Fdagb2w_w@mail.gmail.com>
<TYRPR01MB1419559BE4B38E6EF24EF84BA942D2@TYRPR01MB14195.jpnprd01.prod.outlook.com>
On Wed, Apr 22, 2026 at 3:33 PM Zhijie Hou (Fujitsu)
<[email protected]> wrote:
>
> On Wednesday, April 22, 2026 5:54 PM shveta malik <[email protected]> wrote:
> > On Mon, Apr 20, 2026 at 5:43 PM vignesh C <[email protected]> wrote:
> > >
> > > Hi,
> > >
> > > When changing a table to UNLOGGED, tables that appear in publications
> > > via EXCEPT clauses (prexcept = true) are currently allowed, but their
> > > entries remain in pg_publication_rel.
> > >
> > > For example:
> > > postgres=# create table t1(c1 int);
> > > CREATE TABLE
> > > postgres=# create publication pub1 for all tables except (table t1);
> > > CREATE PUBLICATION postgres=# alter table t1 set unlogged; ALTER TABLE
> > > postgres=# \d t1
> > > Unlogged table "public.t1"
> > > Column | Type | Collation | Nullable | Default
> > > --------+---------+-----------+----------+---------
> > > c1 | integer | | |
> > > Except publications:
> > > "pub1"
> > >
> > > Since UNLOGGED tables are not supported in publications, this leaves
> > > stale catalog entries. This patch removes such entries from
> > > pg_publication_rel when the table is changed to UNLOGGED, and emits a
> > > NOTICE to inform the user.
> > >
> > > Another option considered was to throw an error when setting such
> > > tables to UNLOGGED. However, allowing the operation was preferred,
> > > since UNLOGGED tables do not generate WAL and are not replicated
> > > anyway, so blocking the operation would be unnecessarily restrictive.
> > >
> > > Attached patch has the changes for the same.
> > >
> >
> > The main concern of removal table form EXCEPT-list is that once the table is
> > changed back to LOGGED, there is no internal way to add it to the EXCEPT list
> > again.
> >
> > OTOH, raising an ERROR does not seem like a good solution either. When a
> > user converts a table to UNLOGGED, they are effectively excluding it from
> > publications. Therefore, throwing an error for the purpose that "table is part
> > of EXCEPT, cannot convert it to UNLOGGED" does not appear appropriate,
> > since both actions ultimately exclude the table from publication. I think we
> > can keep the current behavior unchanged as it causes no harm.
>
> I also personally prefer keeping the current behavior, as there is no harm in
> doing so, and I'm not sure whether reporting one more ERROR would make users
> happy.
>
+1.
--
With Regards,
Amit Kapila.
view thread (259+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
Subject: Re: Skipping schema changes in publication
In-Reply-To: <CAA4eK1LvFapjAoDuFmpNi3yjiydk_K5d_QHK=gbiDJNqJOU=2A@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox