Select using Read Committed, clarify please

Friday, May 2, 2014

http://ift.tt/UmXzC1 The docs about Read Committed Isolation Level says



Read Committed is the default isolation level in PostgreSQL. When a transaction uses this isolation level, a SELECT query (without a FOR UPDATE/SHARE clause) sees only data committed before the query began; it never sees either uncommitted data or changes committed during query execution by concurrent transactions. In effect, a SELECT query sees a snapshot of the database as of the instant the query begins to run. However, SELECT does see the effects of previous updates executed within its own transaction, even though they are not yet committed. Also note that two successive SELECT commands can see different data, even though they are within a single transaction, if other transactions commit changes during execution of the first SELECT.



The last sentence confuses me, What does it mean? What if I have not 2 selects in a transaction but 3 and also some calculations without using DML between them? Every select would see a snapshot on the moment of the beginning of it's query?







http://ift.tt/1nSmsbS