NOTE
2.1 PostgreSQL Isolation Levels
PostgreSQL distinguishes isolation levels through snapshot timing. These notes examine the differences through GetTransactionSnapshot and related implementation details.
This is a historical learning note and may contain outdated or incomplete understanding.
1. Implementation
PostgreSQL implements different database isolation levels according to when snapshots are obtained (corresponding to the GetTransactionSnapshot function in the code):
- Read Uncommitted / Read Committed: each query obtains the latest snapshot,
CurrentSnapshotData. - Repeatable Read: all queries obtain the same snapshot, which is the
FirstXactSnapshotobtained by the first query. - Serializable: implemented using the lock system.
2026 note: PostgreSQL’s
READ UNCOMMITTEDis actually handled asREAD COMMITTED; Serializable is also not implemented only with ordinary locks, but through Serializable Snapshot Isolation (SSI) together with predicate locking to detect dependencies that may break serializability.
Drag to pan, scroll to zoom, and click a node to expand or collapse it. Large maps start with deeper levels collapsed; click nodes to expand them.
Discussion
Sign in with GitHub to comment. Discussions are stored as GitHub Issues.View on GitHub