Transactions and Error Handling in PostgreSQL
Jason Myers
Instructor
Isolation Level | Dirty Read | Nonrepeatable Read | Phantom Read | Serialization Anomaly |
---|---|---|---|---|
Read Uncommitted | Protected (PostgreSQL) | vulnerable | vulnerable | vulnerable |
Read Committed | Protected | vulnerable | vulnerable | vulnerable |
Repeatable Read | Protected | Protected | Protected (PostgreSQL) | vulnerable |
Serializable | Protected | Protected | Protected | Protected |
SERIALIZABLE
REPEATABLE READ
START TRANSACTION ISOLATION LEVEL REPEATABLE READ;
UPDATE inventory SET quantity = quantity - 4 WHERE name = 'macaron'; SAVEPOINT first;
UPDATE inventory SET quantity = quantity - 12 SAVEPOINT second; COMMIT;
Transactions and Error Handling in PostgreSQL