Re: "deadlock detected" documentation

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: "deadlock detected" documentation
Дата
Msg-id 28936.1053112428@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: "deadlock detected" documentation  (Matt Mello <alien@spaceship.com>)
Список pgsql-sql
Matt Mello <alien@spaceship.com> writes:
> The two situations I can think of are:
> 1) Two FK fields in a single row pointing to 2 different FK tables, for 
> which any 2 updates get locks in opposite order (seems like a deadlock).

I don't think this is possible, at least in 7.3.  All backends are
guaranteed to run the triggers of a given table in the same order,
so the foreign-row locks should be acquired in the same column order
in all cases.

> 2) Two FK fields pointing to only 1 FK table (both fields are references 
> to the same table), for which each update gets independent locks instead 
> of one lock for both fields, so there is a potential that #1 problem 
> could impact this as well.

Not clear what you mean by "independent locks"; there is only one row
lock on a row.

The cases that I'd be concerned about are not within-row conflicts, but
multi-row conflicts...
        regards, tom lane


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

Предыдущее
От: Randall Lucas
Дата:
Сообщение: Re: Efficiency Issue with "SELECT IN (..)" and "SELECT .. OR .."
Следующее
От: Mike Winter
Дата:
Сообщение: Re: Efficiency Issue with "SELECT IN (..)" and "SELECT .. OR