From 246ec4a51c16f27133a293f63aa8bc86ca4fe630 Mon Sep 17 00:00:00 2001 From: Fujii Masao Date: Thu, 27 Nov 2025 23:29:57 +0900 Subject: [PATCH] doc: Fix misleading synopsis for CREATE/ALTER PUBLICATION. The documentation for CREATE/ALTER PUBLICATION previously showed: [ ONLY ] table_name [ * ] [ ( column_name [, ... ] ) ] [ WHERE ( expression ) ] [, ... ] to indicate that the table/column specification could be repeated. However, placing [, ... ] directly after a multi-part construct was misleading and made it unclear which portion was repeatable. This commit introduces a new term, table_and_columns, to represent: [ ONLY ] table_name [ * ] [ ( column_name [, ... ] ) ] [ WHERE ( expression ) ] and updates the synopsis to use: table_and_columns [, ... ] which clearly identifies the repeatable element. Backpatched to v15, where the misleading syntax was introduced. Author: Peter Smith Reviewed-by: Chao Li Reviewed-by: Fujii Masao Discussion: https://postgr.es/m/CAHut+PtsyvYL3KmA6C8f0ZpXQ=7FEqQtETVy-BOF+cm9WPvfMQ@mail.gmail.com Backpatch-through: 15 --- doc/src/sgml/ref/alter_publication.sgml | 8 ++++++-- doc/src/sgml/ref/create_publication.sgml | 10 +++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/doc/src/sgml/ref/alter_publication.sgml b/doc/src/sgml/ref/alter_publication.sgml index 8dd250d2f3b..028770f2149 100644 --- a/doc/src/sgml/ref/alter_publication.sgml +++ b/doc/src/sgml/ref/alter_publication.sgml @@ -30,13 +30,17 @@ ALTER PUBLICATION name RENAME TO where publication_object is one of: - TABLE [ ONLY ] table_name [ * ] [ ( column_name [, ... ] ) ] [ WHERE ( expression ) ] [, ... ] + TABLE table_and_columns [, ... ] TABLES IN SCHEMA { schema_name | CURRENT_SCHEMA } [, ... ] -where publication_drop_object is one of: +and publication_drop_object is one of: TABLE [ ONLY ] table_name [ * ] [, ... ] TABLES IN SCHEMA { schema_name | CURRENT_SCHEMA } [, ... ] + +and table_and_columns is: + + [ ONLY ] table_name [ * ] [ ( column_name [, ... ] ) ] [ WHERE ( expression ) ] diff --git a/doc/src/sgml/ref/create_publication.sgml b/doc/src/sgml/ref/create_publication.sgml index 66a70e5c5b5..75a508bebfa 100644 --- a/doc/src/sgml/ref/create_publication.sgml +++ b/doc/src/sgml/ref/create_publication.sgml @@ -22,18 +22,22 @@ PostgreSQL documentation CREATE PUBLICATION name - [ FOR { publication_object [, ... ] | all_publication_object [, ... ] } ] + [ FOR { publication_object [, ... ] | publication_all_object [, ... ] } ] [ WITH ( publication_parameter [= value] [, ... ] ) ] where publication_object is one of: - TABLE [ ONLY ] table_name [ * ] [ ( column_name [, ... ] ) ] [ WHERE ( expression ) ] [, ... ] + TABLE table_and_columns [, ... ] TABLES IN SCHEMA { schema_name | CURRENT_SCHEMA } [, ... ] -where all_publication_object is one of: +and publication_all_object is one of: ALL TABLES ALL SEQUENCES + +and table_and_columns is: + + [ ONLY ] table_name [ * ] [ ( column_name [, ... ] ) ] [ WHERE ( expression ) ]