DOCS - CREATE PUBLICATION ... EXCEPT missing details on ONLY

Started by Peter Smith8 months ago5 messageshackers

Thread notes

1 note#docs
hackorum-bot#docs
hackorum-bot
2 days ago

@global #docs

#docs
Jump to latest
#1Peter Smith
smithpb2250@gmail.com

Hi,

Currently, the EXCEPT (TABLE ...) part mentions how 'ONLY' and '*'
work for inheritance tables, but how they have no effect for
partitioned tables [1]https://www.postgresql.org/docs/devel/sql-createpublication.html#SQL-CREATEPUBLICATION-PARAMS-FOR-EXCEPT-TABLE.

It seems we accidentally missed saying that these also have no effect
for *regular* tables.

PSA: a patch to clarify this.

======
[1]: https://www.postgresql.org/docs/devel/sql-createpublication.html#SQL-CREATEPUBLICATION-PARAMS-FOR-EXCEPT-TABLE

Kind Regards,
Peter Smith.
Fujitsu Australia

Attachments:

t139357_1
v1-0001-Fix-note-about-ONLY-to-mention-regular-tables-too.patchapplication/octet-stream; name=v1-0001-Fix-note-about-ONLY-to-mention-regular-tables-too.patchDownload+5-4
#2Amit Kapila
amit.kapila16@gmail.com
In reply to: Peter Smith (#1)
Re: DOCS - CREATE PUBLICATION ... EXCEPT missing details on ONLY

On Fri, Apr 17, 2026 at 5:26 AM Peter Smith <smithpb2250@gmail.com> wrote:

Currently, the EXCEPT (TABLE ...) part mentions how 'ONLY' and '*'
work for inheritance tables, but how they have no effect for
partitioned tables [1].

It seems we accidentally missed saying that these also have no effect
for *regular* tables.

The sentence you quoted speaks about partitioned tables specifically,
so not mentioning regular tables there seems reasonable to me.

--
With Regards,
Amit Kapila.

#3Peter Smith
smithpb2250@gmail.com
In reply to: Amit Kapila (#2)
Re: DOCS - CREATE PUBLICATION ... EXCEPT missing details on ONLY

On Fri, Apr 17, 2026 at 8:44 PM Amit Kapila <amit.kapila16@gmail.com> wrote:

On Fri, Apr 17, 2026 at 5:26 AM Peter Smith <smithpb2250@gmail.com> wrote:

Currently, the EXCEPT (TABLE ...) part mentions how 'ONLY' and '*'
work for inheritance tables, but how they have no effect for
partitioned tables [1].

It seems we accidentally missed saying that these also have no effect
for *regular* tables.

The sentence you quoted speaks about partitioned tables specifically,
so not mentioning regular tables there seems reasonable to me.

I think you missed my point.

The EXCEPT clause syntax allows any of the following:

... EXCEPT (TABLE ONLY parent_table);
... EXCEPT (TABLE parent_table *);

... EXCEPT (TABLE ONLY partitioned_root_table);
... EXCEPT (TABLE partitioned_root_table *);

... EXCEPT (TABLE ONLY regular_table);
... EXCEPT (TABLE regular_table *);

~~

Where:

1. Using ONLY/* for parent_table has a meaning.
2. Using ONLY/* for partitioned_root_table has no meaning but it is
allowed/ignored.
3. Using ONLY/* for regular_table has no meaning but it is allowed/ignored.

The EXCEPT clause documentation already described cases 1 and 2, but
it said nothing about case 3.

I could have left the original 'partitioned tables' paragraph alone,
and then written separately about the regular tables. e.g:
------
For partitioned tables, only the root partitioned table may be
specified in EXCEPT. Doing so excludes the root table and all of its
partitions from replication. The optional ONLY and * has no effect for
partitioned tables.

The optional ONLY and * have no effect for regular tables.
------

But it seemed unnecessarily repetitive, so the patch seperates that
common behaviour to say:
------
For partitioned tables, only the root partitioned table may be
specified in EXCEPT. Doing so excludes the root table and all of its
partitions from replication.

The optional ONLY and * have no effect for regular or partitioned tables.
------

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

#4Amit Kapila
amit.kapila16@gmail.com
In reply to: Peter Smith (#3)
Re: DOCS - CREATE PUBLICATION ... EXCEPT missing details on ONLY

On Mon, Apr 20, 2026 at 5:44 AM Peter Smith <smithpb2250@gmail.com> wrote:

On Fri, Apr 17, 2026 at 8:44 PM Amit Kapila <amit.kapila16@gmail.com> wrote:

On Fri, Apr 17, 2026 at 5:26 AM Peter Smith <smithpb2250@gmail.com> wrote:

Currently, the EXCEPT (TABLE ...) part mentions how 'ONLY' and '*'
work for inheritance tables, but how they have no effect for
partitioned tables [1].

It seems we accidentally missed saying that these also have no effect
for *regular* tables.

The sentence you quoted speaks about partitioned tables specifically,
so not mentioning regular tables there seems reasonable to me.

I think you missed my point.

No, I understood the point but didn't find it useful to add this to
regular tables because they won't have children in any form.

--
With Regards,
Amit Kapila.

#5Peter Smith
smithpb2250@gmail.com
In reply to: Amit Kapila (#4)
Re: DOCS - CREATE PUBLICATION ... EXCEPT missing details on ONLY

On Mon, Apr 20, 2026 at 3:45 PM Amit Kapila <amit.kapila16@gmail.com> wrote:

On Mon, Apr 20, 2026 at 5:44 AM Peter Smith <smithpb2250@gmail.com> wrote:

On Fri, Apr 17, 2026 at 8:44 PM Amit Kapila <amit.kapila16@gmail.com> wrote:

On Fri, Apr 17, 2026 at 5:26 AM Peter Smith <smithpb2250@gmail.com> wrote:

Currently, the EXCEPT (TABLE ...) part mentions how 'ONLY' and '*'
work for inheritance tables, but how they have no effect for
partitioned tables [1].

It seems we accidentally missed saying that these also have no effect
for *regular* tables.

The sentence you quoted speaks about partitioned tables specifically,
so not mentioning regular tables there seems reasonable to me.

I think you missed my point.

No, I understood the point but didn't find it useful to add this to
regular tables because they won't have children in any form.

Because regular tables won't have children in any form, a user could
reasonably worry that saying ONLY or `*` might give a runtime error or
a warning. There is no documentation to say otherwise. The patch
addresses that gap.

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