Re: Order of update triggers

From: "Jean-Yves F(dot) Barbier" <12ukwn(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Order of update triggers
Date: 2012-01-27 18:55:31
Message-ID: 20120127195531.61ea0a57@anubis.defcon1
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Fri, 27 Jan 2012 17:45:41 +0000
Rob Richardson <RDRichardson(at)rad-con(dot)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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Jean-Yves F. Barbier 2012-01-27 19:02:59 Re: Install & Launch PgAdmin on CentOS 6.2 with PostgreSQL 8.4.9
Previous Message Angus 2012-01-27 18:41:27 Install & Launch PgAdmin on CentOS 6.2 with PostgreSQL 8.4.9