I have a unique column. I want to insert a row if it's not already there, and then return the id
of that row.
INSERT INTO t(a) VALUES ('a') ON CONFLICT DO NOTHING RETURNING t.id;
returns nothing at all. Here's a fiddle.
I'm looking for how to get 1 each time, whether 'a' was newly inserted or not.