Postgres heeft geen MERGE verklaring:
https://www.postgresql.org/docs/current/static /sql-commands.html
Gebruik INSERT ON CONFLICT DO in plaats daarvan:
https://www.postgresql.org/docs/current/static /sql-insert.html
Er is enige beweging richting MERGER verklaring, maar het zal niet per se iets zijn dat u verwacht:
https://wiki.postgresql.org/wiki/SQL_MERGE