MERGE is one of the most dangerous structures to convert manually: race conditions, duplicates, and triggers can corrupt data. In PostgreSQL the idiomatic pattern is INSERT ... ON CONFLICT DO UPDATE (upsert).
Conceptual parallel
SQL Server — MERGE
MERGE target AS d USING source AS o ON d.id = o.id WHEN MATCHED THEN UPDATE SET value = o.value WHEN NOT MATCHED THEN INSERT (id, value) VALUES (o.id, o.value);
PostgreSQL — ON CONFLICT
INSERT INTO target (id, value) SELECT id, value FROM source ON CONFLICT (id) DO UPDATE SET value = EXCLUDED.value;