Received: from mail.postgresql.org (webmail.postgresql.org [216.126.85.28]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id f1N2dfx51867 for ; Thu, 22 Feb 2001 21:39:41 -0500 (EST) (envelope-from pgsql-sql-owner@postgresql.org) Received: from csunb0.leeds.ac.uk (csunb0.leeds.ac.uk [129.11.144.2]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id f1IHGbx48085 for ; Sun, 18 Feb 2001 12:16:37 -0500 (EST) (envelope-from iszsb@comp.leeds.ac.uk) Received: from cslin.leeds.ac.uk (csunc0.leeds.ac.uk [129.11.144.3]) by csunb0.leeds.ac.uk (8.6.12/8.6.12) with ESMTP id RAA09230 for ; Sun, 18 Feb 2001 17:14:33 GMT Received: from cslin050.leeds.ac.uk (cslin050 [129.11.146.50]) by cslin.leeds.ac.uk (8.9.3+Sun/) with ESMTP id RAA22950 for ; Sun, 18 Feb 2001 17:14:31 GMT Received: from localhost (iszsb@localhost) by cslin050.leeds.ac.uk (8.11.0/8.11.2) with ESMTP id f1IHEWh27808 for ; Sun, 18 Feb 2001 17:14:33 GMT X-Authentication-Warning: cslin050.leeds.ac.uk: iszsb owned process doing -bs Date: Sun, 18 Feb 2001 17:14:32 +0000 (GMT) From: S Bey X-Sender: To: Subject: Trouble with CREATE FUNCTION Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200102/346 X-Sequence-Number: 1542 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.