Re: Unexpected deadlock across two separate rows, using Postgres 17 and Django's select_for_update()

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Unexpected deadlock across two separate rows, using Postgres 17 and Django's select_for_update()
Дата
Msg-id 30226.1772883929@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Unexpected deadlock across two separate rows, using Postgres 17 and Django's select_for_update()  (Shaheed Haque <shaheedhaque@gmail.com>)
Список pgsql-general
Shaheed Haque <shaheedhaque@gmail.com> writes:
> How can there be a deadlock between updates to different rows (as per the
> bolded WHERE clauses)?

In isolation, there couldn't be ... but you've told us nothing of
what these transactions did beforehand.  The simplest explanation
is that each one is already holding a lock on the row the other
one wants.

Maybe you are not committing between row updates?

If you have no better debugging ideas, try setting log_statements = all
and then examining everything the transactions did up to the failure.

            regards, tom lane



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