Thread: language "plpgsql" does not exist

language "plpgsql" does not exist

From
Bruce Young
Date:
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
INTOlogtable VALUES (logtxt, ''now'');        RETURN ''now'';    END;
 
' LANGUAGE plpgsql;

#  ERROR:  language "plpgsql" does not exist


any help appreciated


__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com


Re: language "plpgsql" does not exist

From
Devrim GUNDUZ
Date:
Hİ,

On Thu, 22 May 2003, Bruce Young wrote:

> #  ERROR:  language "plpgsql" does not exist

Use createlang for installing plpgsql to that database.

usage: createlang plpgsql dbname

Remember that createlang may require additional options like username, 
port, etc. Detailed usage is written in man page.

Regards,
-- 
Devrim GUNDUZ
devrim@gunduz.org                devrim.gunduz@linux.org.tr         http://www.tdmsoft.com
http://www.gunduz.org




Re: language "plpgsql" does not exist

From
"David Witham"
Date:
HI Bruce,

See the createlang shell script in the reference manual under the Client Applications section. You need to "create" a
languagein the target database before you can use it to program with against that database. 

Regards,
David Witham
Telephony Platforms Architect
Unidial

-----Original Message-----
From: Bruce Young [mailto:hbrucey@yahoo.com]
Sent: Friday, 23 May 2003 16:49
To: pgsql-sql@postgresql.org
Subject: [SQL] language "plpgsql" does not exist


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
INTOlogtable VALUES (logtxt, ''now'');        RETURN ''now'';    END; 
' LANGUAGE plpgsql;

#  ERROR:  language "plpgsql" does not exist


any help appreciated


__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly


Re: language "plpgsql" does not exist

From
Richard Huxton
Date:
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
enable it in your database:

createlang plpgsql mydatabase

--  Richard Huxton


Re: language "plpgsql" does not exist

From
Achilleus Mantzios
Date:
On Thu, 22 May 2003, 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

Do
CREATE FUNCTION plpgsql_call_handler () RETURNS language_handler   AS '/usr/local/pgsql/lib/plpgsql.so',
'plpgsql_call_handler'  LANGUAGE c;
 

CREATE TRUSTED PROCEDURAL LANGUAGE plpgsql HANDLER plpgsql_call_handler;

> 
> 
> any help appreciated
> 
> 
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Search - Faster. Easier. Bingo.
> http://search.yahoo.com
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
> 

-- 
==================================================================
Achilleus Mantzios
S/W Engineer
IT dept
Dynacom Tankers Mngmt
Nikis 4, Glyfada
Athens 16610
Greece
tel:    +30-210-8981112
fax:    +30-210-8981877
email:  achill@matrix.gatewaynet.com       mantzios@softlab.ece.ntua.gr



Re: language "plpgsql" does not exist

From
Rod Taylor
Date:
> #  ERROR:  language "plpgsql" does not exist

You need to create it before you may use it.

http://www.postgresql.org/docs/view.php?version=7.3&idoc=1&file=xplang-install.html

--
Rod Taylor <rbt@rbt.ca>

PGP Key: http://www.rbt.ca/rbtpub.asc

Re: language "plpgsql" does not exist

From
Oliver Elphick
Date:
On Fri, 2003-05-23 at 07:48, 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:
...
> #  ERROR:  language "plpgsql" does not exist

Use the createlang script to create the language in that database.

-- 
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight, UK                             http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
========================================   "But where shall wisdom be found? And where is the     place of
understanding?It cannot be gotten for gold,     neither shall silver be weighed for the price thereof.     Whence then
comethwisdom? and where is the place of     understanding? ...Behold the fear of the Lord, that is     wisdom; and to
departfrom evil is understanding."                                            Job 12,15,20,28
 



Re: language "plpgsql" does not exist

From
Christoph Haller
Date:
>
> 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
>

RTFM and refer to the SQL Command CREATE LANGUAGE.
Regards, Christoph





Re: language "plpgsql" does not exist

From
"Victor Yegorov"
Date:
* Bruce Young <hbrucey@yahoo.com> [23.05.2003 14:29]:
> 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

issue the following command on console (comand interpreter):

$ createlang plpgsql <dbname>

-- 

Victor Yegorov


Re: language "plpgsql" does not exist

From
"A.Bhuvaneswaran"
Date:
> 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

The problem is, you have not installed the language 'plpgsql'. It can be 
done using createlang command. 

regards,
bhuvaneswaran



Re: language "plpgsql" does not exist

From
Bruce Young
Date:
Whoa!  thanks a lot guys. didnt RTFM enough.  
i now got it working from the following command:

$ createlang plpgsql <dbname>

Question is: why did it prompt me to enter my password so many times?  4 to be
exact.
i only have one user besides postgres.

thanks again.
- bruce

__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com


Re: language "plpgsql" does not exist

From
PeterKorman
Date:
On Fri, May 23, 2003 at 06:40:04AM -0700, Bruce Young wrote:
> Whoa!  thanks a lot guys. didnt RTFM enough.  
> i now got it working from the following command:
> 
> $ createlang plpgsql <dbname>
> 
> Question is: why did it prompt me to enter my password so many times?  4 to be
> exact.
> i only have one user besides postgres.
> 
> thanks again.
> 

I'm 3 days into postgresql so dont chisel this answer into stone.

I just went through a hunt for this. If you want the plpgsql language to 
show up in all your databases then connect to template1
and do the work within the psql client. I don't see any way to use 
createlang on template1. But that will save you doing it on 
all your databases.

There must be some overhead on this onaccounta it is not part
of template1 to begin with. Odd.

Apparently there are a multitude of possible languages you
can install. PL/Perl, PL/TCL ..., Etc.


Cheers,

JPK




Re: language "plpgsql" does not exist

From
"A.Bhuvaneswaran"
Date:
> Question is: why did it prompt me to enter my password so many times?  4 to be
> exact.
> i only have one user besides postgres.

Run your command with -e option and would answer your query -:)

regards,
bhuvaneswaran