Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardSQLdirty phantom non-repeatable readsSingle-choice MCQ

On a default PostgreSQL install, what does the following sequence print for the final SELECT, and why? (Session B's UPDATE commits between A's two SELECTs.)

-- Session A BEGIN ISOLATION LEVEL REPEATABLE READ; SELECT balance FROM acct WHERE id = 1; -- returns 100 -- Session B (separate connection) UPDATE acct SET balance = 150 WHERE id = 1; COMMIT; -- Session A continues SELECT balance FROM acct WHERE id = 1; -- ?