Re: Reducing likelihood of deadlocks (was referential Integrity and SHARE locks)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Reducing likelihood of deadlocks (was referential Integrity and SHARE locks)
Дата
Msg-id 22565.1171257028@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Reducing likelihood of deadlocks (was referential Integrity and SHARE locks)  (Marc Munro <marc@bloodnok.com>)
Ответы Re: Reducing likelihood of deadlocks (was referential Integrity and SHARE locks)
Список pgsql-hackers
Marc Munro <marc@bloodnok.com> writes:
> Consider a table C containing 2 child records C1 and C2, of parent P.
> If transaction T1 updates C1 and C2, the locking order of the the
> records will be C1, P, C2.  Another transaction, T2, that attempts to
> update only C2, will lock the records in order C2, P.

> The locks on C2 and P are taken in different orders by the two
> transactions, leading to the possibility of deadlock.

But the lock on P is shared, hence no deadlock.
        regards, tom lane


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