Re: function problems.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
Cc: "Duncan Adams (DNS)" <duncan(dot)adams(at)vcontractor(dot)co(dot)za>, pgsql-novice(at)postgresql(dot)org
Subject: Re: function problems.
Date: 2002-10-25 14:11:40
Message-ID: 22691.1035555100@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Oliver Elphick <olly(at)lfix(dot)co(dot)uk> writes:
> A BEFORE trigger must return the NEW row after possible alterations --
> returning NULL will abort the update or insert, so this must be changed
> to be an AFTER trigger.

Or leave it as a BEFORE trigger and do "RETURN NEW" at the end.

I'd recommend BEFORE triggers over AFTER triggers anytime you have the
choice, because AFTER triggers go into a list of things-to-do-later;
if that list gets large (ie, you do many updates in one command) you
will have performance problems.

regards, tom lane

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Rick Szeto 2002-10-25 15:19:29 Latin1 characters in sql scripts
Previous Message Nicolas ... 2002-10-25 13:32:13 Views