Re: Question regarding triggers

From: achill(at)matrix(dot)gatewaynet(dot)com
To: "A(dot)Bhuvaneswaran" <bhuvan(at)symonds(dot)net>
Cc: Dmitri Fuerle <ffo2lp(at)yahoo(dot)com>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Question regarding triggers
Date: 2003-10-20 13:56:10
Message-ID: Pine.LNX.4.44.0310201648560.29584-100000@matrix.gatewaynet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Mon, 20 Oct 2003, A.Bhuvaneswaran wrote:

> > Why dont you try to write your trigger in C?
>
> Hi, one cannot write triggered procedures in C. Currently, it can only be
> written in plpsgql.

Where did you get that impression from?

Do an
SELECT tgrelid,tgfoid,proname from pg_trigger,pg_proc where
tgfoid=pg_proc.oid and prolang=13;
in your system to check if you have any :)

>
> > > CREATE FUNCTION "public"."check_shipment" () RETURNS trigger AS'
> > > begin
> > > If new.shipment_type_id = 4 then
> > > --do something
> > > end if;
> > > return new;
> > > end;
> > > in the above example everything works if shipment_type_id is being
> > > updated. If it is not I will receive a run-time error because
> > > shipment_type_id is not part of the record new.
>
> All the fields of updated record must available in NEW variable. Refer
> the manual for details. Forward your sql & run-time error for further
> assistance.
>
> regards,
> bhuvaneswaran
>
>

--
-Achilleus

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Dmitri Fuerle 2003-10-20 15:07:13 Re: Question regarding triggers
Previous Message Tom Lane 2003-10-20 13:48:52 Re: Question regarding triggers