PostgreSQL · Command
RETURNING
RETURNING lets INSERT, UPDATE, DELETE, and MERGE return data from rows they change. It can avoid a second query and can expose generated, old, new, or trigger-modified values.
Last updated
Syntax
[ RETURNING [ WITH ( { OLD | NEW } AS output_alias [, ...] ) ] { * | output_expression [ [ AS ] output_name ] } [, ...] ]In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
INSERTUPDATEDELETEMERGEOLDNEWRETURN NEXTRETURN QUERY