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

From Stephan Szabo
Subject Re: trigger function in plpgsql (newbie)
Date
Msg-id Pine.BSF.4.21.0110281000510.76258-100000@megazone23.bigpanda.com
Whole thread Raw
In response to trigger function in plpgsql (newbie)  (Gunnar Lindholm <gunnar@gunix.mine.nu>)
List pgsql-general
On Sun, 28 Oct 2001, Gunnar Lindholm wrote:

> create trigger trigger_happy AFTER INSERT ON  T2
>     for each ROW EXECUTE PROCEDURE func_cal();

I think the only problem is that you want a BEFORE INSERT trigger, not
an AFTER INSERT trigger (before triggers can modify the row that is
inserted directly, since the row hasn't been inserted yet).  You may
also want to consider doing this for UPDATE as well since otherwise
the v1*v2 value won't be updated unless you do it manually.


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: trigger function in plpgsql (newbie)
Next
From: Peter Pilsl
Date:
Subject: Re: function given current output-row