From: | Renê Salomão <rene(at)ibiz(dot)com(dot)br> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Cc: | "Thomas LeBlanc" <thomasatiem(at)hotmail(dot)com> |
Subject: | Re: Create Function... ERROR: language "plpgsql" does |
Date: | 2003-10-14 12:05:07 |
Message-ID: | 20031014100507.59749b31.rene@ibiz.com.br |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Hi Thomas,
Did you create/insert plpgsql language in your database? I guess not...
Check your database with createlang -l YOUR_DATABASE_NAME. This should
show you the languages installed in your database. In case you don't
have it, just use createlang plplgsql YOUR_DATABASE_NAME. This should
work...
Suggestion, if you are gonna use plpgsql a lot developing in
Postgresql, I suggest that you create the language you need in template1
(createlang LANGUAGE template1). By doing that you will automatically
create the language in your new database when issuing a createdb
NEWDATABASE, because createdb uses template1 as a template to create
your new database...
RTM createlang for more info...
On Mon, 13 Oct 2003 10:58:55 -0500
"Thomas LeBlanc" <thomasatiem(at)hotmail(dot)com> wrote:
> I copied an example from the help:
>
> CREATE FUNCTION somefunc() RETURNS integer AS '
> DECLARE
> quantity integer := 30;
> BEGIN
> RAISE NOTICE ''Quantity here is %'', quantity; -- Quantity here
> is 30 quantity := 50;
> --
> -- Create a subblock
> --
> DECLARE
> quantity integer := 80;
> BEGIN
> RAISE NOTICE ''Quantity here is %'', quantity; -- Quantity
> here is
> 80
> END;
>
> RAISE NOTICE ''Quantity here is %'', quantity; -- Quantity here
> is 50
>
> RETURN quantity;
> END;
> ' LANGUAGE plpgsql
>
>
> Ran it is a SQL window from pgAdmin and got this error:
>
> ERROR: language "plpgsql" does not exist
>
> Thanks,
> Thomas LeBlanc
>
> _________________________________________________________________
> Share your photos without swamping your Inbox. Get Hotmail Extra
> Storage today! http://join.msn.com/?PAGE=features/es
>
>
> ---------------------------(end of
> broadcast)--------------------------- TIP 1: subscribe and unsubscribe
> commands go to majordomo(at)postgresql(dot)org
>
-----------------------------
Cordialmente,
Renê Salomão
rene(at)ibiz(dot)com(dot)br
rene(dot)salomao(at)interchange(dot)com(dot)br
--------------------------------
From | Date | Subject | |
---|---|---|---|
Next Message | Harry Broomhall | 2003-10-14 12:48:11 | Re: Performance weirdness with/without vacuum analyze |
Previous Message | Patrick Welche | 2003-10-14 11:59:22 | Re: gborg cvs ? |