Dane,

> So the mental model I've built based on the first four sentences of
> the first paragraph is that when a transaction starts in read
> committed mode a snapshot is taken of the (database) universe as it
> exists at the moment of its creation and that it's only updated by
> changes made by the transaction that created the snapshot.

This is (almost) true for the REPEATABLE READ or SERIALIZABLE modes.
(However, the snapshot is taken as the first non-transaction-control statement in the transaction starts.)


For "READ COMMITTED", the docs read (emphasis added):
"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."
        
( http://www.postgresql.org/docs/9.5/static/transaction-iso.html#XACT-READ-COMMITTED )


So if you re-run the same query multiple times within a single transaction, you might get different results depending.


best regards,

        -hannes


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to