Re: Skipping schema changes in publication - Mailing list pgsql-hackers

From Nisha Moond
Subject Re: Skipping schema changes in publication
Date
Msg-id CABdArM4KucFdHYPFCcpvpN7_OVnV5rpnDY7Daz7Cjn6ZuN-dkg@mail.gmail.com
Whole thread
In response to Re: Skipping schema changes in publication  (vignesh C <vignesh21@gmail.com>)
List pgsql-hackers
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

Attachment

pgsql-hackers by date:

Previous
From: Álvaro Herrera
Date:
Subject: Re: Improve docs syntax checking and enable it in the meson build
Next
From: Michael Banck
Date:
Subject: Re: Refactoring postmaster's code to cleanup after child exit