PostgreSQL 的交易與錯誤處理
Jason Myers
Instructor
| 隔離等級 | Dirty Read | Nonrepeatable Read | Phantom Read | Serialization Anomaly |
|---|---|---|---|---|
| Read Uncommitted | 受保護(PostgreSQL) | 易受影響 | 易受影響 | 易受影響 |
| Read Committed | 受保護 | 易受影響 | 易受影響 | 易受影響 |
| Repeatable Read | 受保護 | 受保護 | 受保護(PostgreSQL) | 易受影響 |
| Serializable | 受保護 | 受保護 | 受保護 | 受保護 |
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;
PostgreSQL 的交易與錯誤處理