Beyond Simple Upserts with MERGE in PostgreSQL

Understanding how comfortable someone is with databases and SQL often comes down to the features they use. In PostgreSQL, one such feature that distinguishes more advanced users is the MERGE command, introduced in version 15 and expanded in version 17 (in beta at the time of writing this article). Before MERGE , developers typically relied on INSERT ... ON CONFLICT DO UPDATE for upserts—a method…