Re: BUG #18498: Locking a table from a trigger (with using two sessions) causes a deadlock: the bug or the feature?

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: BUG #18498: Locking a table from a trigger (with using two sessions) causes a deadlock: the bug or the feature?
Дата
Msg-id CAApHDvqOkfS23ds1r_Sk3Za0TRGS8XYOy3rdyeZvarQ6=T6tMQ@mail.gmail.com
обсуждение исходный текст
Ответ на BUG #18498: Locking a table from a trigger (with using two sessions) causes a deadlock: the bug or the feature?  (PG Bug reporting form <noreply@postgresql.org>)
Ответы Re: BUG #18498: Locking a table from a trigger (with using two sessions) causes a deadlock: the bug or the feature?  (David Rowley <dgrowleyml@gmail.com>)
Список pgsql-bugs
On Fri, 7 Jun 2024 at 20:35, PG Bug reporting form
<noreply@postgresql.org> wrote:
> The main question: is the "deadlock detected" error (1) correct?
> (I.e. is it necessary to look for the reason for this behavior?)

Looks like a fairly standard lock upgrade problem to me.

s1: create table t ();
s1: begin;
s2: begin;
s1: lock table t in access share mode;
s2: lock table t in access share mode;
s1: lock table t in access exclusive mode;
s2: lock table t in access exclusive mode; -- deadlock

Isn't this more or less the same as what's going on in your scenario?

David



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

Предыдущее
От: Dmitry Koval
Дата:
Сообщение: Re: BUG #18498: Locking a table from a trigger (with using two sessions) causes a deadlock: the bug or the feature?
Следующее
От: David Rowley
Дата:
Сообщение: Re: BUG #18498: Locking a table from a trigger (with using two sessions) causes a deadlock: the bug or the feature?