PostgreSQL's Default READ COMMITTED Isolation Level Can Silently Lose Updates
PostgreSQL uses READ COMMITTED as its default transaction isolation level, a setting also shared by SQL Server and Oracle. While this level prevents dirty reads — where a transaction sees uncommitted data from another — it offers no protection against lost updates or non-repeatable reads. When two concurrent transactions read the same value, increment it independently, and write back, both can commit the same result, effectively discarding one update without any error or warning. This silent data loss is especially hard to detect under normal load but becomes significant during traffic spikes, causing counters or balances to drift from their true values. Developers often assume wrapping code in BEGIN/COMMIT guarantees safe concurrent access, but atomicity and isolation are distinct ACID properties, and READ COMMITTED provides only weak isolation.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in