Re: Skipping schema changes in publication

Nisha Moond <nisha.moond412@gmail.com>

From: Nisha Moond <nisha.moond412@gmail.com>
To: vignesh C <vignesh21@gmail.com>
Cc: "David G. Johnston" <david.g.johnston@gmail.com>, Shlok Kyal <shlok.kyal.oss@gmail.com>, shveta malik <shveta.malik@gmail.com>, Amit Kapila <amit.kapila16@gmail.com>, Peter Smith <smithpb2250@gmail.com>, Dilip Kumar <dilipbalaut@gmail.com>, "Zhijie Hou (Fujitsu)" <houzj.fnst@fujitsu.com>, YeXiu <1518981153@qq.com>, Ian Lawrence Barwick <barwick@gmail.com>, Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2026-02-16T12:41:16Z
Lists: pgsql-hackers

Attachments

On Mon, Feb 16, 2026 at 8:50 AM vignesh C <vignesh21@gmail.com> wrote:
>
> Thanks for the comments, the attached v44 version patch has the
> changes for the same.
>
I’ve started reviewing/testing the patch. Few comments:

1) File - /doc/src/sgml/catalogs.sgml
       if there is no publication qualifying condition.</para></entry>
      </row>

+     <row>
+      <entry role="catalog_table_entry"><para role="column_definition">
+      <structfield>prexcept</structfield> <type>bool</type>
+      </para>

Should the column order in the doc match the order in
pg_publication_rel? In the table, the "prexcept" column appears before
"prqual", whereas in the doc it is listed after.

pg_publication.c: GetAllPublicationExcludedTables()
2) There may be a scope for optimization in how relids are processed.
Each time a new parentid is appended to the relids list, the first for
loop:

+ while (is_parent_in_except)
+ {
+ List    *parentids = NIL;
+ List    *curr = NIL;
+
+ foreach_oid(relid, relids)     <<< this
+ {
+ Oid parentid;
+
+ if (!get_rel_relispartition(relid))
+ continue;
+

reprocesses all existing relids. Could we restrict it to check only
the newly added relids and avoid redundant work? Does this make sense?

I also feel the function would benefit from a few brief comments to
clarify the logic.

The attached file has the changes for the suggested optimization and
few comment suggestions for the function, if they seem suitable.

--
Thanks,
Nisha

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Fix miscellaneous issues in EXCEPT publication clause.

  2. Change syntax of EXCEPT TABLE clause in publication commands.

  3. Add support for EXCEPT TABLE in ALTER PUBLICATION.

  4. Allow table exclusions in publications via EXCEPT TABLE.

  5. Add wait_for_subscription_sync for TAP tests.