From: | PG Doc comments form <noreply(at)postgresql(dot)org> |
---|---|
To: | pgsql-docs(at)lists(dot)postgresql(dot)org |
Cc: | miguelgilmartinez(at)gmail(dot)com |
Subject: | SQL "RETURNING * | output_expression [ [ AS ]" is wrong |
Date: | 2022-03-21 10:09:55 |
Message-ID: | 164785739575.668.4514247042951418611@wrigleys.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-docs |
The following documentation comment has been logged on the website:
Page: https://www.postgresql.org/docs/14/sql-update.html
Description:
https://www.postgresql.org/docs/14/sql-update.html
Hi! AFAIK, UPDATE .... RETURNING works with INTO varname, not AS
Documentation says:
UPDATE
[ WITH [ RECURSIVE ] with_query [, ...] ]
UPDATE [ ONLY ] table_name [ * ] [ [ AS ] alias ]
SET { column_name = { expression | DEFAULT } |
( column_name [, ...] ) = [ ROW ] ( { expression | DEFAULT } [,
...] ) |
( column_name [, ...] ) = ( sub-SELECT )
} [, ...]
[ FROM from_item [, ...] ]
[ WHERE condition | WHERE CURRENT OF cursor_name ]
[ RETURNING * | output_expression [ [ AS ] output_name ] [, ...] ]
BUT it does not work, it does:
UPDATE
[ WITH [ RECURSIVE ] with_query [, ...] ]
UPDATE [ ONLY ] table_name [ * ] [ [ AS ] alias ]
SET { column_name = { expression | DEFAULT } |
( column_name [, ...] ) = [ ROW ] ( { expression | DEFAULT } [,
...] ) |
( column_name [, ...] ) = ( sub-SELECT )
} [, ...]
[ FROM from_item [, ...] ]
[ WHERE condition | WHERE CURRENT OF cursor_name ]
[ RETURNING * | output_expression [ [ INTO ] output_name ] [, ...] ]
Regards,
Miguel.
From | Date | Subject | |
---|---|---|---|
Next Message | Julien Rouhaud | 2022-03-21 12:12:10 | Re: SQL "RETURNING * | output_expression [ [ AS ]" is wrong |
Previous Message | Tom Lane | 2022-03-20 19:45:09 | Re: systemd service start - disable timeout with "infinity" |