I have a table that looks like this:
| column | def | | ------ | ---- | | id | uuid | | status | int | | data | text |
I'd like to write a query to duplicate a row (changing only a few columns) and return the old (replaced) data:
INSERT INTO tmp (status, data) SELECT source.status, :data FROM table AS source WHERE id = :id RETURNING id, source.data
RETURNING can only access values from the inserted row, is there an alternative to do this?