KNOWLEDGE / PostgreSQL / Transactions
Transactions and Isolation Levels
How database isolation controls what concurrent transactions are allowed to observe.
PostgreSQLTransactionsConsistency
- DOMAIN
- Databases
- LEVEL
- Intermediate
- READ
- 9 min
- UPDATED
- Aug 17, 2026
MENTAL MODEL / KEY IDEAS
Keep these in mind
- 01Isolation is about visible histories
- 02Stronger levels trade concurrency
- 03Application invariants decide the level
The concurrency problem
Transactions can interleave while each statement remains individually correct. Isolation defines which interleavings the database exposes.
- Non-repeatable reads
- Write skew
- Serialization failure
PostgreSQL choices
Read committed is a statement-level snapshot. Repeatable read holds one snapshot, while serializable detects unsafe dependency cycles.
- Read committed
- Repeatable read
- Serializable
Choose from invariants
Write the business invariant first, then test whether the chosen isolation and locking strategy preserves it under concurrency.