Concept
Isolation level
Setting that controls how transaction changes become visible to concurrent transactions.
PostgreSQL supports three effective isolation levels:
- Read Committed (default): each statement sees only data committed before it starts. The same query can return different rows when run twice in the same transaction if another session committed in between (a non-repeatable read).
- Repeatable Read: the entire transaction sees a consistent snapshot taken at its first statement. Concurrent commits never appear.
- Serializable: as if every transaction ran one after another. PostgreSQL detects conflicting access patterns at commit time and aborts one with a serialization failure that the application must retry.
SERIALIZABLE gives the strongest guarantees but requires the application to handle retries. For most OLTP workloads Read Committed is correct; promote to Repeatable Read or Serializable only when invariants spanning multiple rows must hold across concurrent updates.