472,988 Members | 3,176 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,988 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 33407
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: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
3
SueHopson
by: SueHopson | last post by:
Hi All, I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...

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.