Re: DOCS - CREATE PUBLICATION wording re 'ONLY' for partitioned tables.

From: surya poondla <suryapoondla4(at)gmail(dot)com>
To: Peter Smith <smithpb2250(at)gmail(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Takeshi Ideriha <iderihatakeshi(at)gmail(dot)com>, shveta malik <shveta(dot)malik(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
Subject: Re: DOCS - CREATE PUBLICATION wording re 'ONLY' for partitioned tables.
Date: 2026-10-22 18:36:30
Message-ID: CAOVWO5pYXopqCFaABB=HV2Oi5YeWz=_ehJg1ecBA847KtY4ayA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Peter,

I looked at v3. I agree ONLY/* have no effect for partitioned tables in
every ALTER PUBLICATION variant i.e OpenTableList() skips recursion
for RELKIND_PARTITIONED_TABLE regardless of ADD/SET/DROP/EXCEPT.

A few points,

1. Following on from Fujii's point that table_name in ALTER PUBLICATION
also covers DROP, the new note explains ONLY/* only in
terms of adding, which leaves DROP unclear. For example:

CREATE TABLE p (id int) PARTITION BY RANGE (id);
CREATE TABLE p1 PARTITION OF p FOR VALUES FROM (0) TO (100);
CREATE PUBLICATION c FOR TABLE p, p1;
ALTER PUBLICATION c DROP TABLE p *;
-- p1 remains in pg_publication_rel

whereas for a plain inheritance parent, DROP TABLE parent (without ONLY)
also removes the child. Maybe worth saying that dropping a
partitioned table does not remove partitions that were added to the
publication explicitly.

2. A minor point (pre-existing) In CREATE PUBLICATION, the same FOR TABLE
entry already ends with "When a partitioned table is added to a
publication, all of its existing and future partitions are implicitly
considered to be part of the publication...". Both the
old text and v3 repeat that a few lines above, so perhaps just "For a
partitioned table, ONLY and * have no effect." is enough there.

Regards,
Surya Poondla

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Burd 2026-10-22 18:52:50 Re: Expanding HOT updates for expression and partial indexes
Previous Message surya poondla 2026-10-22 18:05:21 Re: tablecmds: Deadlock caused by Attach Partition