I am trying to write a command which adds a row to my postgreSQL table if two of the columns do not contain the same data else where. Neither user_id nor venue_id need to be unique however I do not want to add a new row that has the same user_id AND venue_id as a previous row.
My table
id user_id venue_id like dislike
1 1 1 1 0
2 1 2 0 0
3 2 2 1 1
Currently I am trying
INSERT INTO user_matches (user_id, venue_id) VALUES (1,1) ON CONFLICT DO NOTHING;