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/select.sgml
doc/src/sgml/ref/select_into.sgml
doc/src/sgml/ref/update.sgml

index 1b81b4e7d743f49c52e17deaa6035adec878a7bf..6899887eabb50fdfe53845fbe08b2898aff7c8f3 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 69056a84c3778c7aa61c9030583d2e716e1fa55d..91fa6cf7ed0060a8a29caad4f1dc04d6160816b4 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 2ab24b0523ef2dde94dd427c4a1cc2d64032162c..465f731387dd4277f1f28a42aa91e54466efd53b 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 ] } [, ...] ]