Re: Question regarding triggers

Поиск
Список
Период
Сортировка
От A.Bhuvaneswaran
Тема Re: Question regarding triggers
Дата
Msg-id Pine.LNX.4.44.0310201856130.11594-100000@Bhuvan.bksys.co.in
обсуждение исходный текст
Ответ на Re: Question regarding triggers  (achill@matrix.gatewaynet.com)
Ответы Re: Question regarding triggers  (achill@matrix.gatewaynet.com)
Re: Question regarding triggers  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Question regarding triggers  (Dmitri Fuerle <ffo2lp@yahoo.com>)
Список pgsql-sql
> 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.

> > 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




В списке pgsql-sql по дате отправления:

Предыдущее
От: achill@matrix.gatewaynet.com
Дата:
Сообщение: Re: Question regarding triggers
Следующее
От: achill@matrix.gatewaynet.com
Дата:
Сообщение: Re: Question regarding triggers