Trouble with CREATE FUNCTION - Mailing list pgsql-sql

From S Bey
Subject Trouble with CREATE FUNCTION
Date
Msg-id Pine.LNX.4.30.0102162021570.17254-100000@cslin050
Whole thread Raw
Responses Re: Trouble with CREATE FUNCTION  (Jie Liang <jliang@ipinc.com>)
List pgsql-sql
Dear All,

I have tried creating a function as follows:

CREATE FUNCTION chkTelephone () RETURNS OPAQUE AS '  BEGIN     IF EXISTS (SELECT *                FROM tenant t
      WHERE t.areacode = NEW.areacode AND                      t.telephone = NEW.telphone) THEN        RAISE EXCEPTION
''THATTELEPHONE NUMBER ALREADY EXISTS!'';     END IF;     RETURN NEW;  END;
 
' LANGUAGE 'plpgsql';

However I get the following error:

ERROR:  Unrecognized language specified in a CREATE FUNCTION: 'plpgsql'.
Recognized languages are sql, C, internal and the created procedural
languages.

In the documentation it states that 'PL/pgSQL is a loadable procedural
language for the Postgres database system.'. Where can I load it from and
are there any other problems that may arise?

Cheers, Steve.



pgsql-sql by date:

Previous
From: "Kevin Quinlan"
Date:
Subject: Estimation of SQL statements
Next
From: Jie Liang
Date:
Subject: Re: Can a function return a record set?