PostgreSQL Upserts with INSERT ... ON CONFLICT: Atomic Insert-or-Update
Use INSERT ... ON CONFLICT to insert or update a row atomically when a unique constraint exists, and verify the result with the command tag.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Use INSERT ... ON CONFLICT to insert or update a row atomically when a unique constraint exists, and verify the result with the command tag.
Use SQLite's INSERT ... ON CONFLICT DO UPDATE to replace SELECT-then-write races with a single idempotent statement, provided a UNIQUE or PRIMARY KEY defines the conflict target.