On Wednesday, March 25, 2026 2:07 PM Masahiko Sawada <[email protected]> 
wrote:
> On Tue, Mar 24, 2026 at 11:57 AM Masahiko Sawada
> 
> I figured out that the join with pg_publication works as a filter; 
> non-existence
> publication names are not passed to the function. If we pass the list of
> publication names to the new function signature, while we can simplify the
> patch and avoid a join, we would change the existing function behavior so that
> it ignores non-existence publications.
> 
> I've attached the updated patch. The 0001 patch just incorporated the review
> comments so far, and the 0002 patch is a draft change for the above idea. 
> Since
> pg_get_publication_tables(VARIADIC text) is not a documented function, I think
> we can accept small behavior changes. So I'm going to go with this direction.
> Feedback is very welcome.

Thanks for updating the patches. I have few comments for 0001:

1.

+ * specific table. Otherwise, if returns information for all tables within the
+ * specified publications.

if => it

2.

I think the function shall reject relids that do not reference a valid
publishable table (e.g., sequences, views, or materialized views).

3.

With publish_via_root = true, when both a partitioned table and its child are in
a publication, I expected passing the child's relid will return NULL (changes 
are
published via the root). Currently it returns the child's relid:

CREATE TABLE sales (
    id SERIAL,
    sale_date DATE NOT NULL
) PARTITION BY RANGE (sale_date);

CREATE TABLE sales_2024_q1 PARTITION OF sales
FOR VALUES FROM ('2024-01-01') TO ('2024-04-01');

CREATE publication pub for table sales, sales_2024_q1 with ( 
publish_via_partition_root );

select pg_get_publication_tables('pub', 'sales_2024_q1'::regclass);

Best Regards,
Hou zj

Reply via email to