Isolation Levels for PostgreSQL

[Witness Jo]

2025/12/12

This post describes the isolation levels in PostgreSQL and their implications.

Isolation Levels Overview

PostgreSQL supports four standard isolation levels defined by the SQL standard:

Each level provides different guarantees about the visibility of data changes made by concurrent transactions.

Read Uncommitted

Read Committed

Time f-tx s-tx Value
1 BEGIN 1
2 BEGIN 1
3 READ (1) 1
4 UPDATE … +1 (locks) 1
5 UPDATE … +1 → WAITS 1
6 COMMIT (writes 2) 2
7 → unblocked 2
8 → reloads (2) 2
9 → applies +1 (3) 2
10 → COMMIT (writes 3) 3

Repeatable Read

Time f-tx s-tx Value
1 BEGIN 1
2 BEGIN (snapshot: sees 1) 1
3 READ (1) 1
4 UPDATE … +1 (locks) 1
5 UPDATE … +1 → WAITS 1
6 COMMIT (writes 2) 2
7 ERROR: could not serialize 2
8 → ROLLBACK 2

Serializable