The MERGE Command
summary
Postgres 15 adds a working MERGE that applies INSERT/UPDATE/DELETE from a source to a target per the SQL standard; it decides match status once (so concurrency differs from INSERT ... ON CONFLICT) and can raise duplicate-key or tuple-locked errors, rolling back the whole statement. MERGE supports joins, partitioning, triggers and transition tables, is atomic and optimized for both OLTP and large batches, but currently has no RETURNING, no updatable/materialized/foreign target, no WITH RECURSIVE, and executes row-by-row.
AI-written summary · about
chapters (8)
- 0:00Introduction and background
- 1:33SQL standard and MERGE history
- 6:13MERGE command development
- 8:46MERGE syntax and basics
- 11:55Execution and optimization details
- 26:53Comparison with INSERT ON CONFLICT
- 33:04Privileges and triggers
- 36:59Q&A session








