Re: How do concurrent inserts work?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: How do concurrent inserts work?
Дата
Msg-id 28189.1419702737@sss.pgh.pa.us
обсуждение исходный текст
Ответ на How do concurrent inserts work?  (Yaroslav <ladayaroslav@yandex.ru>)
Ответы Re: How do concurrent inserts work?  (Yaroslav <ladayaroslav@yandex.ru>)
Список pgsql-novice
Yaroslav <ladayaroslav@yandex.ru> writes:
> http://postgresql.nabble.com/Re-BUG-12330-ACID-is-broken-for-unique-constraints-td5832085.html

> I've come to conclusion that I don't understand PostgreSQL transaction
> isolation. :(

In your example, you've already committed the other insertion of "2",
right?  So the serializable transaction *must* fail to insert "2".
The current coding chooses to give you a "duplicate key" error on
the grounds that that's more helpful than a generic "serialization
failure" error.  The debate around bug #12330 is about whether that
is the best choice of error code ... but one way or the other, you're
going to get an error.  On the other hand, the SELECT step isn't going
to show you the "2", because it's in the future so far as the
transaction's snapshot is concerned.

            regards, tom lane


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

Предыдущее
От: David G Johnston
Дата:
Сообщение: Re: How do concurrent inserts work?
Следующее
От: Yaroslav
Дата:
Сообщение: Re: How do concurrent inserts work?