Re: Order of execution of Constraints, Triggers and Rules

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Jean-Luc Lachance <jllachan(at)nsd(dot)ca>
Cc: pgsql General List <pgsql-general(at)postgresql(dot)org>, <pgsql-sql(at)postgersql(dot)org>
Subject: Re: Order of execution of Constraints, Triggers and Rules
Date: 2002-12-06 16:53:09
Message-ID: 20021206085127.V17352-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Fri, 6 Dec 2002, Jean-Luc Lachance wrote:

> Jean-Luc Lachance wrote:
> >
> > Hi all,
> >
> > I know triggers are executed in alphabetical order, but which of
> > constraints, triggers and rules get executed first and which one is
> > last?

I think it's:

Rules are processed (since they're rewrites).
Before triggers (in order)
Check constraints/not null/unique/primary key
After triggers (before the foreign key triggers)
Foreign keys
After triggers (after the foreign key triggers)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2002-12-06 16:57:25 Re: setval('myfunsequence', 0)
Previous Message Jean-Luc Lachance 2002-12-06 16:18:24 Re: Order of execution of Constraints, Triggers and Rules