Re: deadlocks in multiple-triggers environment

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: deadlocks in multiple-triggers environment
Дата
Msg-id 20050609141722.GA10414@surnet.cl
обсуждение исходный текст
Ответ на deadlocks in multiple-triggers environment  (hubert depesz lubaczewski <depesz@gmail.com>)
Ответы Re: deadlocks in multiple-triggers environment
Список pgsql-general
On Wed, Jun 08, 2005 at 05:45:45PM +0200, hubert depesz lubaczewski wrote:
> hi
> i have a stituation a situation where i have multiple tables, and multiple
> triggers on all of them.
> at least 1 or 2 triggers on at lease 4 different tables does updates to main
> cache table.

Do say, are there foreign keys on those tables?

If there are, that may explain the deadlocks.  This is a known problem,
fixed in the development version, for which there is no complete
solution on current releases (except for dropping the foreign keys
completely.)  One workaround that may reduce the ocurrence of deadlocks
is to make the constraints INITIALLY DEFERRED, so that the checks happen
as late as possible in the transaction.

--
Alvaro Herrera (<alvherre[a]surnet.cl>)
Thou shalt check the array bounds of all strings (indeed, all arrays), for
surely where thou typest "foo" someone someday shall type
"supercalifragilisticexpialidocious" (5th Commandment for C programmers)

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

Предыдущее
От: Phil Endecott
Дата:
Сообщение: Propogating conditions into a query
Следующее
От: Csaba Nagy
Дата:
Сообщение: Re: deadlocks in multiple-triggers environment