PostgreSQL INSERT ON CONFLICT: Correct Upsert with Unique Targets, DO NOTHING vs DO UPDATE
Use ON CONFLICT to atomically insert or update rows based on unique constraints. Specify the exact conflict target, handle duplicate input rows, and understand that excluded values replace, not accumulate.
postgresql / sql / upsert / insert / on-conflict / unique-constraint / concurrency / database