advancedIsolation & Anomalies

Why does PostgreSQL's Repeatable Read prevent phantom reads, when the SQL standard doesn't require it to?

PostgreSQL implements Repeatable Read using a single consistent MVCC snapshot taken at the start of the transaction — new rows committed by other transactions simply aren't visible in that snapshot, which incidentally also blocks phantoms, stronger than the standard's minimum requirement.

Ready to master this question?

Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.

Sign in to generate a response

Next Step

Continue to How would you decide isolation level on a per-operation, not per-application, basis?← Back to all Transaction Mastery questions