Re: Cascading Trigger Prevention - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Cascading Trigger Prevention
Date
Msg-id 20071129220959.GF30574@svana.org
Whole thread Raw
In response to Cascading Trigger Prevention  (JonXP <JonEckspee@gmail.com>)
List pgsql-general
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   <kleptog@svana.org>   http://svana.org/kleptog/
> Those who make peaceful revolution impossible will make violent revolution inevitable.
>  -- John F Kennedy

Attachment

pgsql-general by date:

Previous
From: David Fetter
Date:
Subject: Re: Porting from FrontBase
Next
From: Ivan Sergio Borgonovo
Date:
Subject: Re: \copy ... with null as '' csv doesn't get nulls