Re: Is there any way to stop triggers from cycling? - Mailing list pgsql-sql

From Josh Berkus
Subject Re: Is there any way to stop triggers from cycling?
Date
Msg-id 200603081529.09356.josh@agliodbs.com
Whole thread Raw
In response to Re: Is there any way to stop triggers from cycling?  (chester c young <chestercyoung@yahoo.com>)
List 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 by date:

Previous
From: chester c young
Date:
Subject: Re: Is there any way to stop triggers from cycling?
Next
From: Richard Huxton
Date:
Subject: Re: Is there any way to stop triggers from cycling?