Anomaly x isolation matrix (PostgreSQL 18)
Anomalies vs isolation: what PG 18 really does
green = prevented or clean, rose = reproduced live, H-codes map to the simulator histories
anomaly
READ COMMITTED
the default
REPEATABLE READ
= snapshot isolation in PG
SERIALIZABLE
SSI, retry on 40001
dirty read (H1)
even at READ UNCOMMITTED
PREVENTED
PREVENTED
PREVENTED
dirty write (H2)
row lock to end of txn
BLOCKS
BLOCKS
BLOCKS
read skew (H3/H4)
transfer 100, read A then B
SKEW 1100
CLEAN 1000
CLEAN 1000
lost update, RMW (H5)
read 10, write 11 twice
LOST, final 11
LOST, final 11
CLEAN 12
atomic increment (H6)
balance = balance + 1
CLEAN 12
CLEAN 12
CLEAN 12
phantom recount (H7/H8)
COUNT twice, rival INSERTs
2 THEN 3
STABLE 2
STABLE 2
write skew (H9/H10)
two on-call, both step down
EMPTY SET
EMPTY SET
ONE SURVIVOR
H1/H2 are prevention tests: blocking observed, anomaly absent, and that absence is the result
name product + version (PG 18), never the SQL minimum: Oracle calls SI serializable