0PricingLogin
SQL Academy · Lesson

Isolation Levels: READ COMMITTED, REPEATABLE READ, SERIALIZABLE

Compare the SQL standard isolation levels, PostgreSQL's implementation, and pick the right level for your workload.

Four Standard Levels

SQL standard defines four isolation levels:

  • READ UNCOMMITTED
  • READ COMMITTED
  • REPEATABLE READ
  • SERIALIZABLE

PostgreSQL implements three (READ UNCOMMITTED behaves like READ COMMITTED).

READ COMMITTED (PostgreSQL Default)

Each statement sees data committed before the statement started. You may see different snapshots within a single transaction.

-- Inside one transaction:
SELECT balance FROM accounts WHERE id = 1;  -- 100
-- meanwhile another tx commits balance=200
SELECT balance FROM accounts WHERE id = 1;  -- 200  (non-repeatable read)

All lessons in this course

  1. ACID Properties and Anomalies
  2. Isolation Levels: READ COMMITTED, REPEATABLE READ, SERIALIZABLE
  3. Deadlocks: Detection and Avoidance
  4. Optimistic vs Pessimistic Locking
← Back to SQL Academy