I'm using INSERT ... ON CONFLICT ... to be able to upsert some data in a PostgreSQL table.
But now I'd also like to be able to delete some existing rows, if they are not provided by the current INSERT query. So, in addition to INSERT and UPDATE, I would like to be able to do a DELETE.
Using SQL Server, I would do this using a MERGE query and :
WHEN NOT MATCHED BY SOURCE THEN DELETE
What is the recommended way to achieve something similar using PostgreSQL?
I would prefere not to run two separated queries.
MERGEstatement...