Re: SERIALIZABLE and INSERTs with multiple VALUES

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: SERIALIZABLE and INSERTs with multiple VALUES
Дата
Msg-id CACjxUsNNneJx23kWozLx8tfLnVRx6LEpMt1CpNe4Z-6U+m4pew@mail.gmail.com
обсуждение исходный текст
Ответ на Re: SERIALIZABLE and INSERTs with multiple VALUES  (Albe Laurenz <laurenz.albe@wien.gv.at>)
Список pgsql-general
On Wed, Oct 12, 2016 at 2:50 AM, Albe Laurenz <laurenz.albe@wien.gv.at> wrote:
> Kevin Grittner wrote:

>> I don't see that on development HEAD.  What version are you
>> running?  What is your setting for default_transaction_isolation?
>
> The subject says SERIALIZABLE, and I can see it on my 9.5.4 database:

Oh, I see -- it doesn't happen if the row already exists at the
start of the transaction, which it does if you run the OP's entire
sample.  If you skip the transaction in the middle of his sample,
the error occurs.

> test=> CREATE TABLE with_pk (i integer PRIMARY KEY);
> CREATE TABLE
> test=> START TRANSACTION ISOLATION LEVEL SERIALIZABLE;
> START TRANSACTION
> test=> INSERT INTO with_pk VALUES (2), (2) ON CONFLICT DO NOTHING;
> ERROR:  could not serialize access due to concurrent update

Or that, as a nice, self-contained test case.  :-)

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: confusion about user paring with pg_hba and pg_ident
Следующее
От: Chris Richards
Дата:
Сообщение: Re: LOG: munmap(0x7fff80000000) failed: Invalid argument