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*******@postg resql.org 5 33601
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*******@postg resql.org
--
Darren Ferguson
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings
Hi Thomas,
Did you create/insert plpgsql language in your database? I guess not...
Check your database with createlang -l YOUR_DATABASE_N AME. This should
show you the languages installed in your database. In case you don't
have it, just use createlang plplgsql YOUR_DATABASE_N AME. 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*********@ho tmail.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*******@postg resql.org
-----------------------------
Cordialmente,
Renê Salomão re**@ibiz.com.b r re**********@in terchange.com.b r
--------------------------------
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html
Hi Thomas,
Did you create/insert plpgsql language in your database? I guess not...
Check your database with createlang -l YOUR_DATABASE_N AME. This should
show you the languages installed in your database. In case you don't
have it, just use createlang plplgsql YOUR_DATABASE_N AME. 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*********@ho tmail.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*******@postg resql.org
-----------------------------
Cordialmente,
Renê Salomão re**@ibiz.com.b r re**********@in terchange.com.b r
--------------------------------
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html
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.ne t th*********@hot mail.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
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.ne t th*********@hot mail.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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Peter Paskoff |
last post by:
how can i do that?
thx
peter
|
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 languages
Name | Trusted?
---------+----------
|
by: Claudio Lapidus |
last post by:
Hello
I have a table with objects' descriptions:
id | length
---------+--------
object1 | 40
object2 | 66
object3 | 12
object4 | 107
|
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 default on the table, but it was not permitted.
So, now I am trying to figure out how to do it with a trigger or
trigger/function combination.
I tried doing it with a rule using "INSTEAD" on INSERT, but that gave an
"endless recursion" error,...
|
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 this language.
ERROR: permission denied for language plpythonu
Steps:
1º ) createlang - U postgres plpythonu DEVEL
-- however we do not obtain to give to permission
2º) GRANT ALL ON LANGUAGE plpythonu TO PUBLIC;
ERROR: language...
| |
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:
|
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 http://www-106.ibm.com/developerworks/web/library/wa-dbdsgn2.html .
I think I'll go that way too, but I still have some questions on the approach, and would appreciate any advice on it.
Here are some questions I have:
- is it possible to write only one function used for all logging...
|
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 within nested
loops. No problem.
begintest2() simplifies this, omitting the nested loops.
Still no problem.
|
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 varying , integer )
RETURNS void as '
DECLARE
query ALIAS FOR $1;
id ALIAS FOR $2;
BEGIN
EXECUTE query
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |