UPDATE myTable SET (myTable.*) = json_populate_record(...) ?

From: Färber, Franz-Josef (StMUK) <Franz-Josef(dot)Faerber(at)stmuk(dot)bayern(dot)de>
To: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: UPDATE myTable SET (myTable.*) = json_populate_record(...) ?
Date: 2026-08-03 07:09:14
Message-ID: 688383b93cf74558b5b9484ca3c3996a@stmuk.bayern.de
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dear Postgres Community,

cf. https://www.postgresql.org/docs/current/sql-update.html :

As far as I understand, I can

* UPDATE myTable SET col1 = val1, col2 = val2, ...
* UPDATE myTable SET (col1, col2, ...) = <ROW-or-subselect>

But I cannot, and I am missing that:
* UPDATE myTable SET (myTable.*) = <ROW-or-subselect>
* UPDATE myTable SET (col1, col2, ...) = json_populate_record(NULL::myTable, myJson) -- this is a function, not a ROW construct and not a subselect

This would be useful for some of my trigger code.

Regards,
fjf2002

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Daniel Gustafsson 2026-08-03 12:09:18 Re: Adoption vs mail rates
Previous Message Marco Torres 2026-08-03 02:52:51 Re: Adoption vs mail rates