Equivalent of ON CONFLICT DO NOTHING for UPDATE postgres
You can use a correlated subquery with a WHERE NOT EXISTS clause to ensure that your update will not generate duplicates, like : UPDATE mytable t SET (col1, col2) = (‘AAA’, ‘BBB’) WHERE t.col1 = ‘AAB’ and t.col2 = ‘BBA’ AND NOT EXISTS ( SELECT 1 FROM mytable WHERE col1 = ‘AAA’ AND col2 = … Read more