I read Analyzing a read-only transaction anomaly under snapshot isolation. Then, It says read-only transaction anomaly happens in READ COMMITTED and SERIALIZABLE in PostgreSQL as shown below:
Actually, I don't understand read-only transaction anomaly because it is complicated.
And now, I'm trying to produce read-only transaction anomaly in READ COMMITTED in PostgreSQL but I cannot.
My questions:
- What is read-only transaction anomaly?
- How to produce read-only transaction anomaly in
READ COMMITTEDin PostgreSQL?

A transaction anomaly is if the concurrent execution of several transactions produces a result that no serial execution of the transactions could have produced.
The article you reference shows exactly how the anomaly happens in the chapter “How the anomaly occurs”.
It is perfectly normal for this anomaly to occur with
READ COMMITTED. However, it may not occur withSERIALIZABLE. No anomaly whatsoever is allowed to occur underSERIALIZABLEisolation.Since the paper claims that it observed anomalies with PostgreSQL's
SERIALIZABLEisolation, it must have done something wrong. I had a look at the reproducer, but it is written in a language I cannot read. Perhaps the authors misunderstood howSERIALIZABLEworks and counted serialization errors as failures; hard to tell. What points in that direction is that they report lots of failures with Oracle. While it is a fact that Oracle's implementation ofSERIALIZABLEis not correct (it is reallyREAD COMMITTED, and they deliberately misread the SQL standard), it is an implementation that generates so many serialization failures that it is barely usable.So while the article's first three chapters are a correct quotation, the remainder is a mixture of misunderstandings and false assertions.