PostgreSQL Upsert Patterns: When ON CONFLICT Beats Application-Level Logic
PostgreSQL's INSERT ... ON CONFLICT provides atomic upserts that remove race conditions from check‑then‑insert patterns. This post shows a worked event‑ingestion example, how to verify the result, and notes performance trade‑offs when conflict rates are high.