X-Original-To: pgsql-sql@postgresql.org Received: from localhost (unknown [64.117.224.193]) by developer.postgresql.org (Postfix) with ESMTP id 6DB9C9259CC for ; Fri, 23 May 2003 08:07:01 -0400 (EDT) Received: from developer.postgresql.org ([64.117.224.193]) by localhost (developer.postgresql.org [64.117.224.193:10024]) (amavisd-new) with ESMTP id 40332-10 for ; Fri, 23 May 2003 08:06:30 -0400 (EDT) Received: from anchor-post-34.mail.demon.net (anchor-post-34.mail.demon.net [194.217.242.92]) by developer.postgresql.org (Postfix) with ESMTP id 13A629255AC for ; Fri, 23 May 2003 06:26:35 -0400 (EDT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-34.mail.demon.net with esmtp (Exim 3.35 #1) id 19J9kv-0003Nz-0Y; Fri, 23 May 2003 11:26:34 +0100 Received: from localhost (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with ESMTP id 764761627B; Fri, 23 May 2003 11:26:32 +0100 (BST) Received: from client.archonet.com (client.archonet.com [192.168.1.16]) by mainbox.archonet.com (Postfix) with ESMTP id C40D31734C; Fri, 23 May 2003 11:26:31 +0100 (BST) Content-Type: text/plain; charset="iso-8859-1" From: Richard Huxton Organization: Archonet Ltd To: Bruce Young , pgsql-sql@postgresql.org Subject: Re: language "plpgsql" does not exist Date: Fri, 23 May 2003 11:26:31 +0100 User-Agent: KMail/1.4.3 References: <20030523064831.64448.qmail@web10403.mail.yahoo.com> In-Reply-To: <20030523064831.64448.qmail@web10403.mail.yahoo.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200305231126.31947.dev@archonet.com> X-Virus-Scanned: by AMaViS snapshot-20020531 X-Virus-Scanned: by amavisd-new X-Archive-Number: 200305/458 X-Sequence-Number: 13623 On Friday 23 May 2003 7:48 am, Bruce Young wrote: > i am trying to create functions only to get the above error in return. > what do i need to do to get PL/PGSQL functions working? > example: > > CREATE FUNCTION logfunc1(text) RETURNS timestamp AS ' > DECLARE > logtxt ALIAS FOR $1; > BEGIN > INSERT INTO logtable VALUES (logtxt, ''now''); > RETURN ''now''; > END; > ' LANGUAGE plpgsql; > > # ERROR: language "plpgsql" does not exist You need to do a "CREATE LANGUAGE" or use the createlang command-line tool = to=20 enable it in your database: createlang plpgsql mydatabase --=20 Richard Huxton