Re: Logical Replication - revisit `is_table_publication` function implementation

From: Peter Smith <smithpb2250(at)gmail(dot)com>
To: Bingshuai Li <lucian1412(at)outlook(dot)com>
Cc: vignesh C <vignesh21(at)gmail(dot)com>, shveta malik <shveta(dot)malik(at)gmail(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Logical Replication - revisit `is_table_publication` function implementation
Date: 2026-08-20 03:41:13
Message-ID: CAHut+Psce0vjEy6FF6VLOmUQYUH-LJg7qiaRykRdPeROhiArsw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Aug 20, 2026 at 11:40 AM Bingshuai Li <lucian1412(at)outlook(dot)com> wrote:
>
> Hi Peter,
>
> Thanks for the quick v3 — the doc comments and the merged coexistence
> sentences all look good.
>
> One point from my review seems to have been dropped, though. The merged
> comment in is_table_publication() now reads:
>
> /*
> * FOR TABLE cannot be used with FOR ALL TABLES or FOR ALL SEQUENCES.
> */
>
> That states the grammar fact, but not why skipping the
> pg_publication_rel scan is safe: a FOR ALL TABLES publication can still
> have EXCEPT rows there, and returning false is correct precisely because
> those are the only rows it can have. Would you consider keeping one more
> sentence to that effect, e.g.
>
> /*
> * FOR TABLE cannot be used with FOR ALL TABLES or FOR ALL SEQUENCES.
> * A FOR ALL TABLES publication can have only EXCEPT entries in
> * pg_publication_rel, so it never counts as a table publication.
> */
>

The name of the function is "is_table_publication". The purpose is in
the name. Just return T/F if there is "FOR TABLE" clause for the
publication; nothing more.
e.g., if the function was called "is_table_in_pg_publication_rel",
then I would want to explain about EXCEPT.

Since "FOR ALL TABLES" is already mutually exclusive from "FOR TABLE"
I didn't see any need to explain about "FOR ALL TABLES EXCEPT".

Was your review AI-based? It appeared overly concerned about this detail.

Anyway, I am marking this as "ready for committer" so a committer can
decide on this point.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Xuneng Zhou 2026-08-20 04:20:40 Re: timeout value overflow in wait for lsn
Previous Message cca5507 2026-08-20 03:12:47 Re: timeout value overflow in wait for lsn