Re: isn't "insert into where not exists" atomic?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: isn't "insert into where not exists" atomic?
Дата
Msg-id 26970.1296761016@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: isn't "insert into where not exists" atomic?  (Mage <mage@mage.hu>)
Ответы Re: isn't "insert into where not exists" atomic?  (Mage <mage@mage.hu>)
Список pgsql-general
Mage <mage@mage.hu> writes:
> The main question is that isn't "insert into ... select ... where not
> exists" atomic?

No, it isn't: it *will* fail in the presence of other transactions doing
the same thing, because the EXISTS test will only see rows that
committed before the command started.  You might care to read the
manual's chapter about concurrency:
http://www.postgresql.org/docs/9.0/static/mvcc.html

            regards, tom lane

В списке pgsql-general по дате отправления:

Предыдущее
От: Scott Marlowe
Дата:
Сообщение: Re: upgrade
Следующее
От: Bob Price
Дата:
Сообщение: how to avoid repeating expensive computation in select