What happens If a table changes during a query/procedure execution - Mailing list pgsql-hackers

From Vlad Arkhipov
Subject What happens If a table changes during a query/procedure execution
Date
Msg-id 4D774FA9.6070905@dc.baikal.ru
Whole thread Raw
Responses Re: What happens If a table changes during a query/procedure execution
List pgsql-hackers
Let there are two transactions that were created with read commited 
isolation level. In the first one we're executing a SELECT query:
SELECT * FROM t UNION ALL SELECT * FROM t;

In the second transaction we're modifying the same table:
INSERT INTO t DEFAULT VALUES;
COMMIT;

Is it possible that the last UNION part in the first query will retrieve 
not the same rows as the first one?
Another scenario is where we're executing two SELECT queries in a stored 
procedure:
BEGIN  ...  SELECT * FROM t;  SELECT * FROM t;
END;

Is it possible to get different results in the second query? Does SQL 
standard define the behaviour in such cases?


pgsql-hackers by date:

Previous
From: Yeb Havinga
Date:
Subject: Re: Sync Rep and shutdown Re: Sync Rep v19
Next
From: Nicolas Barbier
Date:
Subject: Re: What happens If a table changes during a query/procedure execution