From: Tom Lane Date: Thu, 25 Jul 2024 23:52:08 +0000 (-0400) Subject: Doc: fix misleading syntax synopses for targetlists. X-Git-Tag: REL_16_4~23 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=67ab6ed4182c46077cbcf6e126484fc5e786c6eb;p=postgresql.git Doc: fix misleading syntax synopses for targetlists. 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 masondeanm@aol.com. Discussion: https://postgr.es/m/172193970148.915373.2403176471224676074@wrigleys.postgresql.org --- diff --git a/doc/src/sgml/ref/delete.sgml b/doc/src/sgml/ref/delete.sgml index 1b81b4e7d74..6899887eabb 100644 --- a/doc/src/sgml/ref/delete.sgml +++ b/doc/src/sgml/ref/delete.sgml @@ -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 ] } [, ...] ] diff --git a/doc/src/sgml/ref/insert.sgml b/doc/src/sgml/ref/insert.sgml index 7cea70329e1..6f0adee1a12 100644 --- a/doc/src/sgml/ref/insert.sgml +++ b/doc/src/sgml/ref/insert.sgml @@ -26,7 +26,7 @@ INSERT INTO table_name [ AS 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: diff --git a/doc/src/sgml/ref/select.sgml b/doc/src/sgml/ref/select.sgml index 227ba1993bb..c0acce8a4b6 100644 --- a/doc/src/sgml/ref/select.sgml +++ b/doc/src/sgml/ref/select.sgml @@ -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 [, ...] ] diff --git a/doc/src/sgml/ref/select_into.sgml b/doc/src/sgml/ref/select_into.sgml index 82a77784b99..ae7e6bed24f 100644 --- a/doc/src/sgml/ref/select_into.sgml +++ b/doc/src/sgml/ref/select_into.sgml @@ -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 ] diff --git a/doc/src/sgml/ref/update.sgml b/doc/src/sgml/ref/update.sgml index 2ab24b0523e..465f731387d 100644 --- a/doc/src/sgml/ref/update.sgml +++ b/doc/src/sgml/ref/update.sgml @@ -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 ] } [, ...] ]