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

Reply via email to