Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-novice by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group