Doc: fix misleading syntax synopses for targetlists.
authorTom Lane
Thu, 25 Jul 2024 23:52:08 +0000 (19:52 -0400)
committerTom Lane
Thu, 25 Jul 2024 23:52:08 +0000 (19:52 -0400)
In the syntax synopses for SELECT, INSERT, UPDATE, etc,
SELECT ... and RETURNING ... targetlists were missing { ... }
braces around an OR (|) operator.  That allows misinterpretation
which could lead to confusion.

David G. Johnston, per gripe from [email protected].

Discussion: https://postgr.es/m/172193970148.915373.2403176471224676074@wrigleys.postgresql.org

doc/src/sgml/ref/delete.sgml
doc/src/sgml/ref/insert.sgml
doc/src/sgml/ref/merge.sgml
doc/src/sgml/ref/select.sgml
doc/src/sgml/ref/select_into.sgml
doc/src/sgml/ref/update.sgml

index 0b6fa0051235ae6e680c0213adcd093da4505c2f..7717855bc9ef4877307b8bde1857ab010c5ff7aa 100644 (file)
@@ -25,7 +25,7 @@ PostgreSQL documentation
 DELETE FROM [ ONLY ] table_name [ * ] [ [ AS ] alias ]
     [ USING from_item [, ...] ]
     [ WHERE condition | WHERE CURRENT OF cursor_name ]
-    [ RETURNING * | output_expression [ [ AS ] output_name ] [, ...] ]
+    [ RETURNING { * | output_expression [ [ AS ] output_name ] } [, ...] ]
 
  
 
index 7cea70329e1077f182a55300a5ce0ca85401f88c..6f0adee1a124ab1bf17164d338b32bafce55eacf 100644 (file)
@@ -26,7 +26,7 @@ INSERT INTO table_name [ AS 
     [ OVERRIDING { SYSTEM | USER } VALUE ]
     { DEFAULT VALUES | VALUES ( { expression | DEFAULT } [, ...] ) [, ...] | query }
     [ ON CONFLICT [ conflict_target ] conflict_action ]
-    [ RETURNING * | output_expression [ [ AS ] output_name ] [, ...] ]
+    [ RETURNING { * | output_expression [ [ AS ] output_name ] } [, ...] ]
 
 where conflict_target can be one of:
 
index f63df90c162ba0206f2e1c6046dc4c4d1764ca3f..97b34b9fcaf7ac29b60b53bcc3dbcf9c5e4eefd5 100644 (file)
@@ -25,7 +25,7 @@ PostgreSQL documentation
 MERGE INTO [ ONLY ] target_table_name [ * ] [ [ AS ] target_alias ]
 USING data_source ON join_condition
 when_clause [...]
-[ RETURNING * | output_expression [ [ AS ] output_name ] [, ...] ]
+[ RETURNING { * | output_expression [ [ AS ] output_name ] } [, ...] ]
 
 where data_source is:
 
index 066aed44e6e16344bcf7b6d1c045ce9d5162b0f0..d7089eac0bee77311a43f7cb90733086f8eb46b5 100644 (file)
@@ -34,7 +34,7 @@ PostgreSQL documentation
 
 [ WITH [ RECURSIVE ] with_query [, ...] ]
 SELECT [ ALL | DISTINCT [ ON ( expression [, ...] ) ] ]
-    [ * | expression [ [ AS ] output_name ] [, ...] ]
+    [ { * | expression [ [ AS ] output_name ] } [, ...] ]
     [ FROM from_item [, ...] ]
     [ WHERE condition ]
     [ GROUP BY [ ALL | DISTINCT ] grouping_element [, ...] ]
index 82a77784b99763e20eefe1903692324b9de1f761..ae7e6bed24f2584f5fabbb87634665e3d3fd6106 100644 (file)
@@ -23,7 +23,7 @@ PostgreSQL documentation
 
 [ WITH [ RECURSIVE ] with_query [, ...] ]
 SELECT [ ALL | DISTINCT [ ON ( expression [, ...] ) ] ]
-    * | expression [ [ AS ] output_name ] [, ...]
+    [ { * | expression [ [ AS ] output_name ] } [, ...] ]
     INTO [ TEMPORARY | TEMP | UNLOGGED ] [ TABLE ] new_table
     [ FROM from_item [, ...] ]
     [ WHERE condition ]
index babb34fa511d66f8c729e74a449964cd14705a43..1c433bec2bb8efcfd848af367c34c4f93daea761 100644 (file)
@@ -29,7 +29,7 @@ UPDATE [ ONLY ] table_name [ * ] [
         } [, ...]
     [ FROM from_item [, ...] ]
     [ WHERE condition | WHERE CURRENT OF cursor_name ]
-    [ RETURNING * | output_expression [ [ AS ] output_name ] [, ...] ]
+    [ RETURNING { * | output_expression [ [ AS ] output_name ] } [, ...] ]