From 9d7707f6252b1d0d3ba7025b78011077066f4bca Mon Sep 17 00:00:00 2001 From: Fujii Masao Date: Wed, 22 Jul 2026 11:41:48 +0900 Subject: [PATCH v1] doc: Improve PUBLICATION ... EXCEPT documentation Adjust the CREATE/ALTER PUBLICATION synopsis for ALL TABLES EXCEPT so that it reflects the actual grammar. The first excluded relation requires TABLE, while subsequent relations may optionally repeat TABLE. Also clarify that ALTER PUBLICATION changes the EXCEPT list via SET ALL TABLES rather than by adding except tables, and clean up nearby wording and markup. --- doc/src/sgml/ref/alter_publication.sgml | 29 +++++++++++------------- doc/src/sgml/ref/create_publication.sgml | 10 +++----- 2 files changed, 16 insertions(+), 23 deletions(-) diff --git a/doc/src/sgml/ref/alter_publication.sgml b/doc/src/sgml/ref/alter_publication.sgml index 52114a16a39..3b36b4cad21 100644 --- a/doc/src/sgml/ref/alter_publication.sgml +++ b/doc/src/sgml/ref/alter_publication.sgml @@ -35,7 +35,7 @@ ALTER PUBLICATION name RENAME TO and publication_all_object is one of: - ALL TABLES [ EXCEPT ( except_table_object [, ... ] ) ] + ALL TABLES [ EXCEPT ( TABLE table_object [, [ TABLE ] table_object ] ... ) ] ALL SEQUENCES and publication_drop_object is one of: @@ -47,10 +47,6 @@ ALTER PUBLICATION name RENAME TO table_object [ ( column_name [, ... ] ) ] [ WHERE ( expression ) ] -and except_table_object is: - - TABLE table_object [, ... ] - and table_object is: [ ONLY ] table_name [ * ] @@ -79,13 +75,13 @@ ALTER PUBLICATION name RENAME TO SET ALL TABLES clause can transform an empty publication, or one defined for ALL SEQUENCES (or both ALL TABLES and ALL SEQUENCES), into - a publication defined for ALL TABLES. Likewise, + a publication defined for ALL TABLES. Likewise, SET ALL SEQUENCES can convert an empty publication, or one defined for ALL TABLES (or both ALL TABLES and ALL SEQUENCES), into a publication defined for ALL SEQUENCES. In addition, - SET ALL TABLES can be used to update the tables specified - in the EXCEPT clause of a + SET ALL TABLES can be used to replace or clear the table + list specified in the EXCEPT clause of a FOR ALL TABLES publication. If EXCEPT is specified with a list of tables, the existing exclusion list is replaced with the specified tables. If EXCEPT is omitted, the @@ -97,15 +93,16 @@ ALTER PUBLICATION name RENAME TO - Note that adding tables/except tables/schemas to a publication that is - already subscribed to will require an + Note that adding, dropping, or setting tables or schemas in a publication + that is already subscribed to will require an ALTER SUBSCRIPTION ... REFRESH PUBLICATION action on the subscribing side in order to become effective. Likewise altering a - publication to set ALL TABLES or to set or unset - ALL SEQUENCES also requires the subscriber to refresh the - publication. Note also that DROP TABLES IN SCHEMA will - not drop any schema tables that were specified using + publication to set ALL TABLES, to change the + EXCEPT list, or to set or unset ALL + SEQUENCES also requires the subscriber to refresh the publication. + Note also that DROP TABLES IN SCHEMA will not drop any + schema tables that were specified using FOR TABLE/ ADD TABLE. @@ -126,8 +123,8 @@ ALTER PUBLICATION name RENAME TO ADD TABLES IN SCHEMA, SET TABLES IN SCHEMA, SET ALL TABLES, - and SET ALL SEQUENCES to a publication requires the - invoking user to be a superuser. + and SET ALL SEQUENCES forms require the invoking user to + be a superuser. To alter the owner, you must be able to SET ROLE to the new owning role, and that role must have CREATE privilege on the database. diff --git a/doc/src/sgml/ref/create_publication.sgml b/doc/src/sgml/ref/create_publication.sgml index 85cfcaddafa..d39cc12caca 100644 --- a/doc/src/sgml/ref/create_publication.sgml +++ b/doc/src/sgml/ref/create_publication.sgml @@ -32,17 +32,13 @@ CREATE PUBLICATION name and publication_all_object is one of: - ALL TABLES [ EXCEPT ( except_table_object [, ... ] ) ] + ALL TABLES [ EXCEPT ( TABLE table_object [, [ TABLE ] table_object ] ... ) ] ALL SEQUENCES and table_and_columns is: table_object [ ( column_name [, ... ] ) ] [ WHERE ( expression ) ] -and except_table_object is: - - TABLE table_object [, ... ] - and table_object is: [ ONLY ] table_name [ * ] @@ -173,7 +169,7 @@ CREATE PUBLICATION name Marks the publication as one that replicates changes for all tables in the database, including tables created in the future. Tables listed in - EXCEPT clause are excluded from the publication. + the EXCEPT clause are excluded from the publication. @@ -218,7 +214,7 @@ CREATE PUBLICATION name 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 + ONLY and * have no effect for partitioned tables. -- 2.55.0