From c7301c3b6fe2feaf96d52cbf35a85ac6b95374dc Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 25 Jul 2024 19:52:08 -0400 Subject: [PATCH] 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 --- doc/src/sgml/ref/delete.sgml | 2 +- doc/src/sgml/ref/insert.sgml | 2 +- doc/src/sgml/ref/merge.sgml | 2 +- doc/src/sgml/ref/select.sgml | 2 +- doc/src/sgml/ref/select_into.sgml | 2 +- doc/src/sgml/ref/update.sgml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/src/sgml/ref/delete.sgml b/doc/src/sgml/ref/delete.sgml index 0b6fa005123..7717855bc9e 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/merge.sgml b/doc/src/sgml/ref/merge.sgml index f63df90c162..97b34b9fcaf 100644 --- a/doc/src/sgml/ref/merge.sgml +++ b/doc/src/sgml/ref/merge.sgml @@ -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: diff --git a/doc/src/sgml/ref/select.sgml b/doc/src/sgml/ref/select.sgml index 066aed44e6e..d7089eac0be 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 babb34fa511..1c433bec2bb 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 ] } [, ...] ] -- 2.30.2