Re: Multiple TRIGGERs and OLD versus NEW "records"

From: Jorge Godoy <jgodoy(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Multiple TRIGGERs and OLD versus NEW "records"
Date: 2007-03-14 19:11:51
Message-ID: 871wjrk5c8.fsf@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

> Jorge Godoy <jgodoy(at)gmail(dot)com> writes:
>> If I change some column -- e.g. fill in some automatic calculated column or a
>> timestamp column --, when I run the second trigger will OLD be the data stored
>> at the database already or will it be affected by the NEW data returned from
>> the previous trigger?
>
> OLD is the data actually in the database. NEW is the currently proposed row.
> So prior triggers can change what you see as NEW, but not OLD.
>
> regards, tom lane

Thanks, Tom. It's like I supposed. I was going to test it tonight when I get
to my office but you saved me from that :-)

--
Jorge Godoy <jgodoy(at)gmail(dot)com>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-03-14 19:25:15 Re: How to write a function that manipulates a set of results
Previous Message Randall Smith 2007-03-14 19:08:09 pre-parser query manipulation