Databases · Flashcard

What is write skew?

  • ATwo transactions read overlapping data and then write different rows, leaving a state no serial order allows
  • BTwo transactions write the very same row, and the commit that lands second silently discards the first value
  • COne transaction reads a row twice and sees two different values because another commit landed in between
  • DOne transaction reads rows another has written but not committed, and keeps that result after the rollback

Why this is the answer

In write skew each transaction checks a condition, finds it satisfied, and writes somewhere the other one did not look — individually legal, jointly impossible, which is why snapshot isolation alone cannot catch it. Overwriting the same row is a lost update, seeing a changed value on re-read is a non-repeatable read, and reading uncommitted data is a dirty read, which PostgreSQL never permits.

Official docs
Study in Gnoseed →