pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: chester c young <chestercyoung@yahoo.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Is there any way to stop triggers from cycling?
Date: Wed, 8 Mar 2006 15:29:09 -0800
Message-ID: <200603081529.09356.josh@agliodbs.com> (raw)
In-Reply-To: <20060308230419.53923.qmail@web54308.mail.yahoo.com>
References: <20060308230419.53923.qmail@web54308.mail.yahoo.com>

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



view thread (5+ messages)  latest in thread

Message-ID: <200603081529.09356.josh@agliodbs.com>
Permalink:  ../200603081529.09356.josh@agliodbs.com/
Also on:    postgresql.org/message-id/200603081529.09356.josh@agliodbs.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: josh@agliodbs.com, chestercyoung@yahoo.com
  Subject: Re: Is there any way to stop triggers from cycling?
  In-Reply-To: <200603081529.09356.josh@agliodbs.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox