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

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: chester c young <chestercyoung(at)yahoo(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Is there any way to stop triggers from cycling?
Date: 2006-03-08 23:29:09
Message-ID: 200603081529.09356.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Richard Huxton 2006-03-09 10:21:13 Re: Is there any way to stop triggers from cycling?
Previous Message chester c young 2006-03-08 23:04:18 Re: Is there any way to stop triggers from cycling?