Re: BUG #13723: "duplicate key" error occurs when update delete and insert the same row concurrently

Поиск
Список
Период
Сортировка
От Jeff Janes
Тема Re: BUG #13723: "duplicate key" error occurs when update delete and insert the same row concurrently
Дата
Msg-id CAMkU=1w4oe2Wqn9O4A4+rZG=Yo26FY6vOB7CeicWP1tUyCk7WA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #13723: "duplicate key" error occurs when update delete and insert the same row concurrently  (chenhj <chjischj@163.com>)
Список pgsql-bugs
On Mon, Oct 26, 2015 at 10:47 AM, chenhj <chjischj@163.com> wrote:

> >Can you reproduce the problem under a higher transaction isolation level?
> >
> >Cheers,
> >
> >Jeff
>
> Under higher transaction isolation level(REPEATABLE READ or SERIALIZABLE),
> only one transaction's UPDATE could be executed, the second transaction's
> UPDATE will be blocked util the first transaction committed and then
> throw "could not serialize access due to concurrent update" error.
>

Yes, this is the correct  behavior.  It can't serialize, so it gives an
error which the user can then decide how to handle (simply retry the same
transaction would probably be best, in this case).

It would be nice if pgbench had a mode where it would do the retry for you
upon retryable errors, but right now it doesn't.

Cheers,

Jeff

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

Предыдущее
От: chenhj
Дата:
Сообщение: Re: BUG #13723: "duplicate key" error occurs when update delete and insert the same row concurrently
Следующее
От: felipe@felipegasper.com
Дата:
Сообщение: BUG #13736: pg_dump should use E'' quotes