From: S Bey <iszsb@comp.leeds.ac.uk>
To: pgsql-sql@postgresql.org
Subject: Trouble with CREATE FUNCTION
Date: Sun, 18 Feb 2001 17:14:32 +0000 (GMT)
Message-ID: <Pine.LNX.4.30.0102162021570.17254-100000@cslin050> (raw)
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 ''THAT TELEPHONE 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.
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: iszsb@comp.leeds.ac.uk
Subject: Re: Trouble with CREATE FUNCTION
In-Reply-To: <Pine.LNX.4.30.0102162021570.17254-100000@cslin050>
References: <Pine.LNX.4.30.0102162021570.17254-100000@cslin050>
* 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