Re: Question regarding triggers - Mailing list pgsql-sql

From achill@matrix.gatewaynet.com
Subject Re: Question regarding triggers
Date
Msg-id Pine.LNX.4.44.0310201622140.29584-100000@matrix.gatewaynet.com
Whole thread Raw
In response to Question regarding triggers  (Dmitri Fuerle <ffo2lp@yahoo.com>)
Responses Re: Question regarding triggers  ("A.Bhuvaneswaran" <bhuvan@symonds.net>)
List pgsql-sql
Why dont you try to write your trigger in C?

On Mon, 20 Oct 2003, Dmitri Fuerle wrote:

>  
>    I'm writing a trigger but running into problems.  My problem is that I can not determine anyway to tell what
fieldsare in the *new* record.  Without knowing what fields are there I get runtime errors if that's not what is being
updatedexample:
 
>  
> 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
errorbecause shipment_type_id is not part of the record new.
 
>  
> Please help,
> Dmitri
>  
> 
> 
> 
> ---------------------------------
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product search

-- 
-Achilleus



pgsql-sql by date:

Previous
From: Dmitri Fuerle
Date:
Subject: Question regarding triggers
Next
From: "A.Bhuvaneswaran"
Date:
Subject: Re: Question regarding triggers