Re: Is there any way to stop triggers from cycling?

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: Is there any way to stop triggers from cycling?
Дата
Msg-id 200603081529.09356.josh@agliodbs.com
обсуждение исходный текст
Ответ на Re: Is there any way to stop triggers from cycling?  (chester c young <chestercyoung@yahoo.com>)
Список pgsql-sql
Chester,

> take advantage of "instead of" or "do also" rules to create a compound
> statement before your triggers do their work.  (in terms of maintenance
> and sanity, it's best if a trigger touches only its own record.)

Ah, I see ... so:

1) create a view on the table
2) put a rule on the view to re-order, which re-orders the *table* so 
there's no cascade
3) use the triggers to do the other tree-maintenance stuff, only for their 
own rows/children (cascading triggers work *very* well for tree 
maintenance).

-- 
--Josh

Josh Berkus
Aglio Database Solutions
San Francisco


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

Предыдущее
От: chester c young
Дата:
Сообщение: Re: Is there any way to stop triggers from cycling?
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: Is there any way to stop triggers from cycling?