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 c3f49f7398071e4d18edb4797715d5fe2fed0d6c..1aa7a7ecbac60dbed3163a0e064435c2e7b64146 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 0181d2b9a06ed8415d0673e220d88188fd13e3ca..bec28ab7103b6752df1e73100373f0e79efa9581 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 3fa54e5f703b0c55bb237649a03a3746d98e12f4..2d659f3779ea479f10f25b1e99fb72071b366cc6 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 ] } [, ...] ]