Re: function problems. - Mailing list pgsql-novice

From Tom Lane
Subject Re: function problems.
Date
Msg-id 22691.1035555100@sss.pgh.pa.us
Whole thread Raw
In response to Re: function problems.  (Oliver Elphick <olly@lfix.co.uk>)
List pgsql-novice
Oliver Elphick <olly@lfix.co.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

pgsql-novice by date:

Previous
From: Ludwig Lim
Date:
Subject: Re: function problems.
Next
From: "Rick Szeto"
Date:
Subject: Latin1 characters in sql scripts