PostgreSQL – UPSERT
An “upsert” operation refers to the ability to update an existing row if it exists, or insert a new row if it doesn’t exist, based on a specified condition. The upsert operation is also known as “merge” or “insert on conflict update.” INSERT INTO target_table (column1, column2, …) VALUES (value1, value2, …) ON CONFLICT (unique_constraint_columns)…