Re: Multiple triggers/rules - Mailing list pgsql-general

From Tom Lane
Subject Re: Multiple triggers/rules
Date
Msg-id 10216.982768645@sss.pgh.pa.us
Whole thread Raw
In response to Multiple triggers/rules  (brichard@cafod.org.uk (Bruce Richardson))
Responses Re: Multiple triggers/rules
List pgsql-general
brichard@cafod.org.uk (Bruce Richardson) writes:
> How would I check the order triggers will be run in, where a
> column/table has multiple triggers on it?  Is there a way to change that
> order?

It's essentially random, and you can't control or change it.  If you
have interdependent actions in different triggers, you'll probably have
to combine those triggers so that you can know the ordering of the
actions.  If the triggers are independent, though, there's no reason
to care what order they fire in.

> And while I'm at it, can you define more than one rule for the same
> event on the one table?

Yes, with the same ordering issues as for triggers.

            regards, tom lane

pgsql-general by date:

Previous
From: "Neil Burrows"
Date:
Subject: Inheritance Question
Next
From: "Gregory Wood"
Date:
Subject: Deferred NOT NULL?