News for hackers. Stuff that matters.
Re:The Many Faces of Distinct in PostgreSQL by jack_squat on Monday May 22, 2023 @04:05PM (#36036035)
Atomicity doesn't mean "doesn't fail", it means "either fails or succeeds, but does not succeed halfway".

There is nothing about what you are describing that is different from the behavior you'd get from a regular insert or update. If two transactions conflict, a rollback will occur. That isn't violating atomicity. In fact, it is the way by which atomicity is guaranteed.

The behavior of sequence values getting incremented and not committed, resulting in gaps in the sequence, is a separate matter, not specific to Postgres or to upsert.

There are no comments on this comment yet.