Re: trigger function in plpgsql (newbie)

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Gunnar Lindholm <gunnar(at)gunix(dot)mine(dot)nu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: trigger function in plpgsql (newbie)
Date: 2001-10-28 18:02:16
Message-ID: Pine.BSF.4.21.0110281000510.76258-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Patrice Hédé 2001-10-28 18:03:05 Re: UNICODE
Previous Message Stephan Szabo 2001-10-28 17:57:57 Re: Problem with some function