3 ms·
I don't know first hand, but could take a guess: Think of a transaction that inserts a row representing a withdrawal, updates a materialized total balance, and
by jasonwatkinspdx 12y ago
I don't know first hand, but could take a guess:
Think of a transaction that inserts a row representing a withdrawal, updates a materialized total balance, and checks that it's positive. Under snapshot isolation, two concurrent instances of this transaction could commit. The materialized balance would reflect only one of the debits however, and would be inconsistent vs queries that recompute the aggregate in full.
Postgres pre version 9.2-ish would allow this situation even in "serializable" mode. Later versions wouldn't.
- jeffdavis 12y agoDid you actually try in postgres? If so, please provide an example.
- jasonwatkinspdx 12y agoRead the papers.