Re: no cascade triggers?

Поиск
Список
Период
Сортировка
От A.M.
Тема Re: no cascade triggers?
Дата
Msg-id 111FDF55-3EF9-478A-BD82-7F1C144AABEC@themactionfaction.com
обсуждение исходный текст
Ответ на no cascade triggers?  (Chris Mair <chris@1006.org>)
Список pgsql-hackers
On Jun 26, 2007, at 10:04 , Chris Mair wrote:

> Hello,
>
>
> On the italian list we're discussing a case were a user reportedly
> worked around this (i.e. got rid of unwanted cascading calls) by
> writing an on insert trigger procedure something on the lines of:
>
> ALTER TABLE tab DISABLE TRIGGER USER;
>  -- do more inserts into the same table
> ALTER TABLE tab ENABLE TRIGGER USER;
>
> While this reporetedly worked well in 8.2.1 it does not in 8.2.4
> resulting in an error:
>
>   ERROR: relation "distinta_base1" is being used by active queries
>   in this session Stato SQL: 55006
>
> Now -- while we agree that disabling a trigger from inside itself
> is a somewhat strange thing to do, we cannot see a good and easy
> solution to the problem (of avoiding cascading trigger calls).
>
> General question: would a "no cascade" clause for triggers be a
> todo item?

Instead of putting a trigger on the table, put a rule+trigger on a  
wrapper view.

Cheers,
M


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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: [COMMITTERS] pgsql: Arrange for quote_identifier() and pg_dump to not quote keywords
Следующее
От: Tom Lane
Дата:
Сообщение: Re: no cascade triggers?