pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andreas Joseph Krogh <andreak@officenet.no>
To: pgsql-sql@postgresql.org
Subject: Re: Trigger Problem
Date: Thu, 20 Sep 2001 10:56:33 -0000
Message-ID: <E15k1VR-0004v1-00@www.nettverk.no> (raw)

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>





view thread (10+ messages)  latest in thread

Message-ID: <E15k1VR-0004v1-00@www.nettverk.no>
Permalink:  ../E15k1VR-0004v1-00@www.nettverk.no/
Also on:    postgresql.org/message-id/E15k1VR-0004v1-00@www.nettverk.no

 · 

reply

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: andreak@officenet.no
  Subject: Re: Trigger Problem
  In-Reply-To: <E15k1VR-0004v1-00@www.nettverk.no>

* 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