On 8/12/20 7:23 AM, pinker wrote:
is there any way to distinct between updated and inserted rows in RETURNING
clause when ON CONFLICT UPDATE was used?

Do you want to use that information immediately in the query or store it somewhere? If the first case I don't think that is possible. For the second then, I haven't tried it but, maybe a trigger using transition tables per example here:

https://www.postgresql.org/docs/12/plpgsql-trigger.html

Example 42.7. Auditing with Transition Tables




--
Sent from: https://www.postgresql-archive.org/PostgreSQL-general-f1843780.html




--
Adrian Klaver
adrian.kla...@aklaver.com


Reply via email to