Re: Trigger Problem - Mailing list pgsql-sql

From Andreas Joseph Krogh
Subject Re: Trigger Problem
Date
Msg-id E15k1VR-0004v1-00@www.nettverk.no
Whole thread Raw
In response to Trigger Problem  (Mohammad Faisal <faisalchouhan@yahoo.com>)
List pgsql-sql
Mohammad Faisal <faisalchouhan@yahoo.com> said:

> hey all
> 
> 
> I have created a function that is used in a trigger. 
> 
> --------------------------------------------------
> --------------------------------------------------
> 
> CREATE TRIGGER tr_insert_on_a AFTER INSERT OR UPDATE
> ON A
> FOR EACH ROW EXECUTE PROCEDURE fn_insert_on_a();
> 
> --------------------------------------------------
> --------------------------------------------------
> 
> CREATE function fn_insert_on_a() RETURNS OPAQUE AS
>  '
> BEGIN
>           INSERT INTO B name, a_ref VALUES   
> (NEW.name,NEW.id);
> RETURN NEW;
> END;
> 
> ' LANGUAGE 'plpgsql';
> 
> 
> I am getting following error.
> ERROR :
> 
> Unrecognized language specified in a CREATE FUNCTION:
> plpgsql. Recognized languages are sql,c,internal and
> the created procedure languages.
> 
> NOTE:
> 
> I have studied in documenatation that only plpgsql
> functions are written to be used in triggers.

You need to issue:
$ createlang plpgsql <db_name>
to create the plpgsql language on your database.

-- 
Andreas Joseph Krogh <andreak@officenet.no>




pgsql-sql by date:

Previous
From: "David M. Richter"
Date:
Subject: table restruction
Next
From: Kovacs Baldvin
Date:
Subject: Re: table restruct...