Use multiple conflict_target in ON CONFLICT clause
I have two columns in table col1 , col2 , they both are unique indexed (col1 is unique and so is col2). I need at insert into this table, use ON CONFLICT syntax and update other columns, but I can't use both column in conflict_target clause. It works: INSERT INTO table ... ON CONFLICT ( col1 ) DO UPDATE SET -- update needed columns here But how to do this for several columns, something like this: ... ON CONFLICT ( col1, col2 ) DO UPDATE SET .... e4c5 A sample table and data CREATE TABLE dupes(col1 int primary key, col2 int, col3 text, CONSTRAINT col2_unique UNIQUE (col2) ); INSERT INTO dupes