Search Postgresql Archives

Re: A contradiction in 13.2.1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux