Re: why dropping a trigger may cause a deadlock

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: why dropping a trigger may cause a deadlock
Дата
Msg-id 13035.1244237719@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: why dropping a trigger may cause a deadlock  (Ivan Sergio Borgonovo <mail@webthatworks.it>)
Ответы Re: why dropping a trigger may cause a deadlock  (Ivan Sergio Borgonovo <mail@webthatworks.it>)
Список pgsql-general
Ivan Sergio Borgonovo <mail@webthatworks.it> writes:
> I don't get it.
> Why dropping the triggers would cause a deadlock anyway?

> I bet it is due to my naïve view of the problem but I think a
> trigger is a "function". Unless there is concurrent access to the
> table where the function is defined... I can't see why dropping the
> "functions" serially should cause a lock.

They're not just functions, they are part of the DDL for a table.
Adding or removing a trigger on a table requires exclusive lock
on that table, otherwise you can't be sure what will happen in
concurrent transactions that might (or might not) be supposed to
fire the trigger.

            regards, tom lane

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

Предыдущее
От: "Atul Chojar"
Дата:
Сообщение: Re: How to automatically propagate new/changed database functions from one database to another
Следующее
От: Joshua Tolley
Дата:
Сообщение: Re: Using results from DELETE ... RETURNING