Re: Skipping schema changes in publication

From: Andrei Lepikhov <lepihov(at)gmail(dot)com>
To: vignesh C <vignesh21(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Shlok Kyal <shlok(dot)kyal(dot)oss(at)gmail(dot)com>, Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>, shveta malik <shveta(dot)malik(at)gmail(dot)com>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Peter Smith <smithpb2250(at)gmail(dot)com>, "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>, YeXiu <1518981153(at)qq(dot)com>, Ian Lawrence Barwick <barwick(at)gmail(dot)com>, Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Skipping schema changes in publication
Date: 2026-02-25 13:39:18
Message-ID: CAMMNXX=nFgcPc5_zes3MU7kwuCx8xsuBDHVBYF6LCsT1kHU_Nw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 25/2/26 08:04, vignesh C wrote:
> On Mon, 23 Feb 2026 at 16:46, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> The attached patch has the changes for the same i.e.a) Raises an error
> when attempting to attach a partition to a root partitioned table if
> that table is referenced in an EXCEPT clause of any publication. b)
> Adds support for dropping excluded tables using: ALTER PUBLICATION ...
> DROP EXCEPT TABLE. c) Adds support for replacing the exclusion list
> using ALTER PUBLICATION ... SET EXCEPT TABLE.
> The changes related to DROP EXCEPT TABLE and SET EXCEPT TABLE have
> been kept separately into patch 0002 for easier review.

I discovered this patch, maybe not deeply enough. But one question raised.

I usually work with multiple tables (sometimes hundreds, if not
thousands). EXCEPT clause might be quite rare. Some commands want to
extract only excepted tables from the publication using the following
pattern:

'SELECT ... FROM pg_publication_rel WHERE prpubid = <X> AND pr.prexcept'

- check_publications_except_list()
- describePublications()
- getPublications()
- LoadPublications() / publication_has_any_except_table()

That means pass through all the publication tables to find (usually)
nothing. It might be a costly operation, especially in the
LoadPublications routine. Maybe slightly change index
pg_publication_rel_prpubid_index a little and add 'prexcept' as a second
column there? It might avoid performance issues that may arise during
the upgrade.

--
regards, Andrei Lepikhov,
pgEdge

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Zsolt Parragi 2026-02-25 13:43:54 Re: Reduce planning time for large NOT IN lists containing NULL
Previous Message Peter Eisentraut 2026-02-25 13:33:29 Re: Make use of unvolatize() in vac_truncate_clog()