← BACK TO KNOWLEDGE

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

  1. 01Isolation is about visible histories
  2. 02Stronger levels trade concurrency
  3. 03Application invariants decide the level
01

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
02

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
03

Choose from invariants

Write the business invariant first, then test whether the chosen isolation and locking strategy preserves it under concurrency.