Forum OpenACS Q&A: Re: PostgreSQL MVCC transaction model

Collapse
Posted by russ m on
OUCH! I just refered to the definitive documentation (ie. observed behaviour of the software) and yes, 2 pure selects within a single transaction will see changes commited by a concurrent transaction when running in Read Comitted. That's not what I read the documentation to be saying.
Session ASession B

scratch=# create table foo (bar varchar);
CREATE TABLE
scratch=# select * from foo ;
 bar 
-----
(0 rows)

scratch=# insert into foo (bar) values ('baz');
INSERT 63323 1
scratch=# begin transaction;
BEGIN
scratch=# select * from foo;
 bar 
-----
 baz
(1 row)
 
 

scratch=# update foo set bar = 'xyzzy' where bar = 'baz';
UPDATE 1

scratch=# select * from foo;
  bar  
-------
 xyzzy
(1 row)