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
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 ] } [, ...] ]
[ 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:
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 ] } [, ...] ]
[ 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 [, ...] ]
[ 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 ]
} [, ...]
[ FROM from_item [, ...] ]
[ WHERE condition | WHERE CURRENT OF cursor_name ]
- [ RETURNING * | output_expression [ [ AS ] output_name ] [, ...] ]
+ [ RETURNING { * | output_expression [ [ AS ] output_name ] } [, ...] ]