Re: Cascading Trigger Prevention

Поиск
Список
Период
Сортировка
От JonXP
Тема Re: Cascading Trigger Prevention
Дата
Msg-id 3fa58163-4ad2-4802-a7f1-2080c5a2f942@e4g2000hsg.googlegroups.com
обсуждение исходный текст
Ответ на Cascading Trigger Prevention  (JonXP <JonEckspee@gmail.com>)
Список pgsql-general
On Nov 29, 5:09 pm, klep...@svana.org (Martijn van Oosterhout) wrote:
> On Wed, Nov 28, 2007 at 02:00:58PM -0800, JonXP wrote:
> > I have a table that contains a nested set (using paths), and I'm
> > trying to create a trigger that updates the timestamps of a node and
> > all of its parents on a modification.  Unfortunately, this is causing
> > infinitely recurring triggers.
>
> > The insert occurs, which fires the trigger, which then updates all of
> > the parent rows, which then fires the trigger again for each update,
> > which recurses yet again.
>
> You can disable triggers on a table but it's definitly not recommended
> (deadlock prone) but it seems to me that if when the trigger is fired
> it only updates its parent everything should work, right? As it
> recurses up the tree eventually it reaches the end, surely?
>
> Have a nice day,
> --
> Martijn van Oosterhout   <klep...@svana.org>  http://svana.org/kleptog/
>
> > Those who make peaceful revolution impossible will make violent revolution inevitable.
> >  -- John F Kennedy
>
>
>
>  signature.asc
> 1KDownload

Yes, that was one of two approaches I am considering taking.  I was
trying to update all of the parent nodes in one query (which is why I
used this particular method of nested sets) but just recursing up the
tree could also work.

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

Предыдущее
От: "Gautam Sampathkumar"
Дата:
Сообщение: "relation deleted while in use" encountered with Postgresql 8.0.8
Следующее
От: "Andrus"
Дата:
Сообщение: Re: log_line_prefix='%t %u %d %h %p %i %l %x ' causes error