Обсуждение: BEGIN/END question ...

Поиск
Список
Период
Сортировка

BEGIN/END question ...

От
The Hermit Hacker
Дата:
In v6.5.3, if I do:

BEGIN;
SELECT * FROM <table> WHERE <datefield> < now();
DELETE FROM <table> WHERE <datafield> < now();
END;

and, between the SELECT/DELETE, someone inserts data into the table that
matches the WHERE clause, will the DELETE pick that up also?

I know its an odd question, but if I have any faint understanding of MVCC,
it won't, because when I issue the BEGIN/SELECT, it will "timestamp" my
transaction and only affect those tuples that were in existence when I
started ...

... but I want to confirm :)

Marc G. Fournier                   ICQ#7615664               IRC Nick: Scrappy
Systems Administrator @ hub.org
primary: scrappy@hub.org           secondary: scrappy@{freebsd|postgresql}.org