Re: trigger function in plpgsql (newbie) - Mailing list pgsql-general

From Tom Lane
Subject Re: trigger function in plpgsql (newbie)
Date
Msg-id 5768.1004290658@sss.pgh.pa.us
Whole thread Raw
In response to trigger function in plpgsql (newbie)  (Gunnar Lindholm <gunnar@gunix.mine.nu>)
List pgsql-general
Gunnar Lindholm <gunnar@gunix.mine.nu> writes:
> Hello. I'm  a total newbie when it comes to plpgsql and trigger functions, but
> here is my code that does not work

You need a BEFORE INSERT trigger, not AFTER INSERT.  After the insertion
is too late to change the row that will be stored.

            regards, tom lane

pgsql-general by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Problem with some function
Next
From: Stephan Szabo
Date:
Subject: Re: trigger function in plpgsql (newbie)