00 /What You Will Learn
By the end you will be able to
- Say what a transaction is, and what an isolation level decides.
- Show a dirty read, a non-repeatable read and a phantom read, and say which isolation level stops each in PostgreSQL.
- Reproduce a lost update and fix it with one
UPDATE ... WHEREstatement or withSELECT ... FOR UPDATE. - Reproduce write skew, and see
SERIALIZABLEstop it with error40001. - Explain why code that uses
SERIALIZABLEmust be ready to retry.
Before you start
Finish Lab 04 (SQL Basics) first. You should be able to read SELECT, UPDATE ... WHERE, and know what BEGIN and COMMIT mean. Docker Desktop must be running.
Lab-only password
The password in this lab is lab_only_password. It exists only on your laptop, for practice. A real database never gets a password like that.