RETURNING to_jsonb(...)

From: Miles Elam <miles(dot)elam(at)productops(dot)com>
To: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: RETURNING to_jsonb(...)
Date: 2020-05-05 20:11:11
Message-ID: CAALojA_MaDC5TnjiaF8hPZ6vmXjuRVEpRc7zPOXPx8jfyWp0Dw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

How can the new record returned from RETURNING to converted to jsonb?

For example something like:

INSERT INTO my_table (a, b, c) VALUES ('a', 'b', 'c')
RETURNING to_jsonb(*);

or

UPDATE my_table SET a = 'a'
RETURNING to_jsonb(*);

or

INSERT INTO my_table (a, b, c) VALUES ('a', 'b', 'c')

ON CONFLICT DO UPDATE SET a = EXCLUDED.a

RETURNING to_jsonb(*);

Thanks in advance

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2020-05-05 20:18:02 Re: PostgreSQL client hangs sometimes on 'EXEC SQL PREPARE sid_sisisinst FROM :select_anw;'
Previous Message Peter J. Holzer 2020-05-05 19:33:11 Re: Thoughts on how to avoid a massive integer update.