From 081544a59478e9d44a0ec7b7d42e66c8dd0c268e Mon Sep 17 00:00:00 2001
From: "houzj.fnst" <houzj.fnst@cn.fujitsu.com>
Date: Mon, 13 Sep 2021 09:57:36 +0800
Subject: [PATCH] doc diff

---
 doc/src/sgml/ref/alter_publication.sgml  | 14 ++++++++------
 doc/src/sgml/ref/create_publication.sgml |  8 ++++++--
 src/backend/parser/gram.y                | 20 ++++++++++++--------
 3 files changed, 26 insertions(+), 16 deletions(-)

diff --git a/doc/src/sgml/ref/alter_publication.sgml b/doc/src/sgml/ref/alter_publication.sgml
index b3cef9d..a2f5e6e 100644
--- a/doc/src/sgml/ref/alter_publication.sgml
+++ b/doc/src/sgml/ref/alter_publication.sgml
@@ -21,15 +21,17 @@ PostgreSQL documentation
 
  <refsynopsisdiv>
 <synopsis>
-ALTER PUBLICATION <replaceable class="parameter">name</replaceable> ADD { TABLE [ ONLY ] <replaceable class="parameter">table_name</replaceable> [ * ] [, ...] }
-    | { ALL TABLES IN SCHEMA { <replaceable class="parameter">schema_name</replaceable> | CURRENT_SCHEMA } [, ...] }
-ALTER PUBLICATION <replaceable class="parameter">name</replaceable> SET { TABLE [ ONLY ] <replaceable class="parameter">table_name</replaceable> [ * ] [, ...] }
-    | { ALL TABLES IN SCHEMA { <replaceable class="parameter">schema_name</replaceable> | CURRENT_SCHEMA } [, ...] }
-ALTER PUBLICATION <replaceable class="parameter">name</replaceable> DROP { TABLE [ ONLY ] <replaceable class="parameter">table_name</replaceable> [ * ] [, ...] }
-    | { ALL TABLES IN SCHEMA { <replaceable class="parameter">schema_name</replaceable> | CURRENT_SCHEMA } [, ...] }
+ALTER PUBLICATION <replaceable class="parameter">name</replaceable> ADD <replaceable class="parameter">publication object</replaceable> [, ...]
+ALTER PUBLICATION <replaceable class="parameter">name</replaceable> SET <replaceable class="parameter">publication object</replaceable> [, ...]
+ALTER PUBLICATION <replaceable class="parameter">name</replaceable> DROP <replaceable class="parameter">publication object</replaceable> [, ...]
 ALTER PUBLICATION <replaceable class="parameter">name</replaceable> SET ( <replaceable class="parameter">publication_parameter</replaceable> [= <replaceable class="parameter">value</replaceable>] [, ... ] )
 ALTER PUBLICATION <replaceable class="parameter">name</replaceable> OWNER TO { <replaceable>new_owner</replaceable> | CURRENT_ROLE | CURRENT_USER | SESSION_USER }
 ALTER PUBLICATION <replaceable class="parameter">name</replaceable> RENAME TO <replaceable>new_name</replaceable>
+
+<phrase>where <replaceable class="parameter">publication object</replaceable> is one of:</phrase>
+
+    TABLE [ ONLY ] <replaceable class="parameter">table_name</replaceable> [ * ] [, ... ]
+    ALL TABLES IN SCHEMA { <replaceable class="parameter">schema_name</replaceable> | CURRENT_SCHEMA } [, ... ]
 </synopsis>
  </refsynopsisdiv>
 
diff --git a/doc/src/sgml/ref/create_publication.sgml b/doc/src/sgml/ref/create_publication.sgml
index aaced75..0ca7e7c 100644
--- a/doc/src/sgml/ref/create_publication.sgml
+++ b/doc/src/sgml/ref/create_publication.sgml
@@ -23,9 +23,13 @@ PostgreSQL documentation
 <synopsis>
 CREATE PUBLICATION <replaceable class="parameter">name</replaceable>
     [ FOR ALL TABLES 
-      | [ FOR { TABLE [ ONLY ] <replaceable class="parameter">table_name</replaceable> [ * ] [, ... ], }
-          | { ALL TABLES IN SCHEMA { <replaceable class="parameter">schema_name</replaceable> | CURRENT_SCHEMA } [, ... ]  }  ] ]
+      | FOR <replaceable class="parameter">publication object</replaceable> [, ... ] ]
     [ WITH ( <replaceable class="parameter">publication_parameter</replaceable> [= <replaceable class="parameter">value</replaceable>] [, ... ] ) ]
+
+<phrase>where <replaceable class="parameter">publication object</replaceable> is one of:</phrase>
+
+    TABLE [ ONLY ] <replaceable class="parameter">table_name</replaceable> [ * ] [, ... ]
+    ALL TABLES IN SCHEMA { <replaceable class="parameter">schema_name</replaceable> | CURRENT_SCHEMA } [, ... ]
 </synopsis>
  </refsynopsisdiv>
 
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index 9e91f1a..f7bf83e 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -9598,9 +9598,13 @@ AlterOwnerStmt: ALTER AGGREGATE aggregate_with_argtypes OWNER TO RoleSpec
  *
  * CREATE PUBLICATION FOR ALL TABLES [WITH options]
  *
- * CREATE PUBLICATION FOR TABLE [WITH options]
+ * CREATE PUBLICATION FOR pub_obj [, pub_obj2] [WITH options]
+ *
+ * pub_obj is one of:
+ *
+ *		TABLE table [, table2]
+ *		ALL TABLES IN SCHEMA schema [, schema2]
  *
- * CREATE PUBLICATION FOR ALL TABLES IN SCHEMA [WITH options]
  *****************************************************************************/
 
 CreatePublicationStmt:
@@ -9690,17 +9694,17 @@ pub_obj_list: 	PublicationObjSpec
  *
  * ALTER PUBLICATION name SET ( options )
  *
- * ALTER PUBLICATION name ADD TABLE table [, table2]
+ * ALTER PUBLICATION name ADD pub_obj [, pub_obj2]
  *
- * ALTER PUBLICATION name DROP TABLE table [, table2]
+ * ALTER PUBLICATION name DROP pub_obj [, pub_obj2]
  *
- * ALTER PUBLICATION name SET TABLE table [, table2]
+ * ALTER PUBLICATION name SET pub_obj [, pub_obj2]
  *
- * ALTER PUBLICATION name ADD ALL TABLES IN SCHEMA schema [, schema2]
+ * pub_obj is one of:
  *
- * ALTER PUBLICATION name DROP ALL TABLES IN SCHEMA schema [, schema2]
+ *		TABLE table [, table2]
+ *		ALL TABLES IN SCHEMA schema [, schema2]
  *
- * ALTER PUBLICATION name SET ALL TABLES IN SCHEMA schema [, schema2]
  *****************************************************************************/
 
 AlterPublicationStmt:
-- 
2.7.2.windows.1

