473,396 Members | 1,760 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Create Function... ERROR: language "plpgsql" does not exist

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 ma*******@postgresql.org

Nov 12 '05 #1
5 33530
You do not have the language installed in the database.

use the createlang function in the bin directory and create the langiage
for the data base i.e.

createlang -d dbname plpgsql

HTH
Darren

On Mon, 13 Oct 2003, Thomas LeBlanc 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 ma*******@postgresql.org


--
Darren Ferguson
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 12 '05 #2
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" <th*********@hotmail.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 ma*******@postgresql.org

-----------------------------

Cordialmente,

Renê Salomão
re**@ibiz.com.br
re**********@interchange.com.br

--------------------------------

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 12 '05 #3
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" <th*********@hotmail.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 ma*******@postgresql.org

-----------------------------

Cordialmente,

Renê Salomão
re**@ibiz.com.br
re**********@interchange.com.br

--------------------------------

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 12 '05 #4
You need to create the plpgsql language in your database first. See
http://www.faqs.org/docs/ppbook/c19610.htm for how to do this.

Hope this helps,
ch**@crashed.net

th*********@hotmail.com ("Thomas LeBlanc") wrote in message news:<La*************************@hotmail.com>...
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

Nov 12 '05 #5
You need to create the plpgsql language in your database first. See
http://www.faqs.org/docs/ppbook/c19610.htm for how to do this.

Hope this helps,
ch**@crashed.net

th*********@hotmail.com ("Thomas LeBlanc") wrote in message news:<La*************************@hotmail.com>...
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

Nov 12 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Amin Schoeib | last post by:
Hi, When I Try to write Functions I always become the error That the language plpgsql doesn't exist. I tried it this way: createlang plpgsql template1 createlang -l template1 Procedural...
3
by: Claudio Lapidus | last post by:
Hello I have a table with objects' descriptions: id | length ---------+-------- object1 | 40 object2 | 66 object3 | 12 object4 | 107
3
by: Barbara Lindsey | last post by:
I have a case where I am collecting a "Start Date" and an "End Date". I would like to default the "End Date" to the "Start Date" value if only the "Start Date" is entered. I tried setting this as...
0
by: Cláudia Morgado | last post by:
Good afternoon lists! Somebody that it works with the Pl/Phyton language could in helping them? We create the language python, however a common user, does not obtain to create a function using...
4
by: Markus Bertheau | last post by:
Hi, why does everyone write CREATE FUNCTION foo() RETURNS INTEGER AS ' blah blah ' LANGUAGE 'plpgsql'; I've never seen for example:
5
by: Raphael Bauduin | last post by:
Hi, I'm looking at the logging of a database we'll put in production soon. I've seen some posts on this list about history tables, like mentioned in...
1
by: Karl O. Pinc | last post by:
FYI, mostly. But I do have questions as to how to write code that will continue to work in subsequent postgresql versions. See code below. begintest() uses EXIT to exit a BEGIN block from...
3
by: osman7king | last post by:
I use the EXECUTE statement in a procedure which has 2 parameters, one is to hold the query, and the other for the value used in the query create or replace function delete_from_table1(character...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.