Re: Question regarding triggers

From: achill(at)matrix(dot)gatewaynet(dot)com
To: Dmitri Fuerle <ffo2lp(at)yahoo(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Question regarding triggers
Date: 2003-10-20 13:22:39
Message-ID: Pine.LNX.4.44.0310201622140.29584-100000@matrix.gatewaynet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 fields are in the *new* record. Without knowing what fields are there I get runtime errors if that's not what is being updated example:
>
> 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.
>
> Please help,
> Dmitri
>
>
>
>
> ---------------------------------
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product search

--
-Achilleus

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message A.Bhuvaneswaran 2003-10-20 13:31:43 Re: Question regarding triggers
Previous Message Kumar 2003-10-20 13:04:48 Scripting only the functions