Re: Setting NEW in AFTER trigger

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: robert(at)webtent(dot)com
Cc: PostgreSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: Setting NEW in AFTER trigger
Date: 2008-12-15 16:45:09
Message-ID: 2704.1229359509@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Robert Fitzpatrick <lists(at)webtent(dot)net> writes:
> Is it not possible to set the value of a field by reference of NEW.field
> in an AFTER trigger?

An AFTER trigger can't retroactively affect the update that already
happened, if that's what you're imagining this would do. Use a BEFORE
trigger if you want to affect what gets stored.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ketema Harris 2008-12-15 17:49:13 Trigger/Rules Order of operations
Previous Message Jonathon Suggs 2008-12-15 16:40:34 Re: Query Question (one group by vs two separate)