What happens If a table changes during a query/procedure execution

Поиск
Список
Период
Сортировка
От Vlad Arkhipov
Тема What happens If a table changes during a query/procedure execution
Дата
Msg-id 4D774FA9.6070905@dc.baikal.ru
обсуждение исходный текст
Ответы Re: What happens If a table changes during a query/procedure execution  (Nicolas Barbier <nicolas.barbier@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: Yeb Havinga
Дата:
Сообщение: Re: Sync Rep and shutdown Re: Sync Rep v19
Следующее
От: Nicolas Barbier
Дата:
Сообщение: Re: What happens If a table changes during a query/procedure execution