I've expected that the SQL-statement
INSERT ... RETURNING *
would always return something but it seems to work only after the first insertion. The following insertions don't fail but also don't return anything. Is it the expected behavior of the statement?
I have a table identities
that has a unique constraint on the columns mrn
and name
. I want to insert a record:
INSERT INTO identities (mrn, name) VALUES('x', 'y') on conflict do nothing returning id;
I get the id
as expected
1b3e43cc-722a-4703-91d3-6839287b6eff
But the second insert doesn't return anything.