From: achill@matrix.gatewaynet.com
To: A.Bhuvaneswaran <bhuvan@symonds.net>
Cc: Dmitri Fuerle <ffo2lp@yahoo.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Question regarding triggers
Date: Mon, 20 Oct 2003 16:56:10 +0300 (EEST)
Message-ID: <Pine.LNX.4.44.0310201648560.29584-100000@matrix.gatewaynet.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0310201856130.11594-100000@Bhuvan.bksys.co.in>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: achill@matrix.gatewaynet.com, bhuvan@symonds.net, ffo2lp@yahoo.com
Subject: Re: Question regarding triggers
In-Reply-To: <Pine.LNX.4.44.0310201648560.29584-100000@matrix.gatewaynet.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox