Isolation levels in PostgreSQL
On This Lesson 4 topics
This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.
In this lesson
know what each level prevents in PostgreSQL specifically.
Planned topics
READ COMMITTED(default): each statement sees committed data; allows non-repeatable reads, phantoms, lost updates, write skew.REPEATABLE READ: one snapshot per transaction (snapshot isolation); prevents dirty, non-repeatable, phantom reads; detects some lost updates by failing with a serialization error; still allows write skew.SERIALIZABLE: prevents all anomalies by detecting dangerous patterns and aborting one transaction.- PostgreSQL never allows dirty reads;
READ UNCOMMITTEDbehaves asREAD COMMITTED. - Higher levels mean you must retry on failure (SQLSTATE
40001).
Draft outline details
Demonstration
a table of five anomalies by three levels with yes/no.
Check your understanding
Does READ COMMITTED prevent lost updates for a read-modify-write in application code?
Show answer
No.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.