Re: Order of update triggers - Mailing list pgsql-novice

From Jean-Yves F. Barbier
Subject Re: Order of update triggers
Date
Msg-id 20120127195531.61ea0a57@anubis.defcon1
Whole thread Raw
In response to Re: Order of update triggers  (Rob Richardson <RDRichardson@rad-con.com>)
List pgsql-novice
On Fri, 27 Jan 2012 17:45:41 +0000
Rob Richardson <RDRichardson@rad-con.com> wrote:

> (Of course, all triggers are fired within a single transaction,
> and inside a transaction, terms like "before", "after" and
> "already" are effectively meaningless.  Right?)

Absolutely not: you have "time stages", even into a single
transaction.

ie: * Table TBA contains a "price" column,
    * Trigger TR1 creates an average of "price"
    * If you launch TR1 BEFORE (insert), the new value you're about
       to insert won't be accounted
    * If you trigger TR1 AFTER (insert), it will.

And alphabetic order only matters for the same family (event)
of triggers.

--
Men will fuck mud.
        -- Lenny Bruce

pgsql-novice by date:

Previous
From: Angus
Date:
Subject: Install & Launch PgAdmin on CentOS 6.2 with PostgreSQL 8.4.9
Next
From: "Jean-Yves F. Barbier"
Date:
Subject: Re: Install & Launch PgAdmin on CentOS 6.2 with PostgreSQL 8.4.9