how to return all the columns not just the updated columns when update in postgresql? let's say i have this update statement
UPDATE person set age = 20,location = 'us' WHERE id = 1234

based from documentation of postgresql on UPDATE , it can only return updated fields.
but I want to get all fields regardless if it's updated or not. e.g i have name, first name, gender and where not updated in my UPDATE query.
RETURNING *

doesn't work
Your understanding of the documentation saying &quot;you can only return columns you use&quot; is incorrect
You can list all the columns you want to return. You can even list results of functions or use values that are nothing to do with the columns at all, like you would in a SELECT:
UPDATE person set age = age+1,location = 'us' WHERE id = 1234
RETURNING id, age, location, name, &quot;first name&quot;, gender, &quot;where&quot;, CONCAT(&quot;first name&quot;, ' ', name) as fullname, 1+2 as three
--                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
--                &quot;i have name, first name, gender and where not updated&quot;

https://dbfiddle.uk/?rdbms=postgres_13&amp;fiddle=5ad1bc7b45c4e73da351adedf987b0c3
And as HWNN points out, you can have RETURNING * .. check your original query for syntax errors