Transactions et gestion des erreurs dans PostgreSQL
Jason Myers
Instructor




| Niveau d'isolement | Lecture sale | Lecture non reproductible | Lecture fantôme | Anomalie de sérialisation |
|---|---|---|---|---|
| Read Uncommitted | Protégé (PostgreSQL) | vulnérable | vulnérable | vulnérable |
| Read Committed | Protégé | vulnérable | vulnérable | vulnérable |
| Repeatable Read | Protégé | Protégé | Protégé (PostgreSQL) | vulnérable |
| Serializable | Protégé | Protégé | Protégé | Protégé |
START TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
SELECT COUNT(*) FROM cookies WHERE name = 'lemon drop';
-- Cookie 6 has been added in an external transaction.
SELECT COUNT(*) FROM cookies WHERE name = 'lemon drop';
COMMIT;
Résultats des instructions
START TRANSACTION ISOLATION LEVEL SERIALIZABLE;
SELECT COUNT(*) FROM cookies WHERE name = 'lemon drop';
-- Cookie 6 has been added in an external transaction.
SELECT COUNT(*) FROM cookies WHERE name = 'lemon drop';
COMMIT;
Résultats des instructions
Transactions et gestion des erreurs dans PostgreSQL