I have two columns in table col1, col2, they both are unique indexed (col1 is unique and so is col2).
col1
col2
I need at insert into this table, u
Vlad got the right idea.
First you have to create a table unique constraint on the columns col1, col2 Then once you do that you can do the following:
col1, col2
INSERT INTO dupes values(3,2,'c') ON CONFLICT ON CONSTRAINT dupes_pkey DO UPDATE SET col3 = 'c', col2 = 2