createlang

Started by eoghanover 20 years ago7 messagesgeneral
Jump to latest
#1eoghan
postgres@redry.net

Hello
Im trying to load plpgsql into my test db... Im wondering if theres a
way to check if its loaded... I do:
test-# createlang plpgsql test
test-#
When i try load an example function:
test-# \i test.sql
Im getting:
psql:test.sql:5: ERROR: language "plpgsql" does not exist
HINT: You need to use "createlang" to load the language into the
database.
Anyone any hints for me?
Thanks
Eoghan

#2Joshua D. Drake
jd@commandprompt.com
In reply to: eoghan (#1)
Re: createlang

eoghan wrote:

Hello
Im trying to load plpgsql into my test db... Im wondering if theres a
way to check if its loaded... I do:
test-# createlang plpgsql test

createlang is a command line client:

bash# createlang -U postgres -P 5432 plpgsql database

What you are looking for is:

CREATE LANGUAGE.

Sincerely,

Joshua D. Drake

--
Your PostgreSQL solutions company - Command Prompt, Inc. 1.800.492.2240
PostgreSQL Replication, Consulting, Custom Programming, 24x7 support
Managed Services, Shared and Dedicated Hosting
Co-Authors: plPHP, plPerlNG - http://www.commandprompt.com/

#3James Cradock
jcradock@me3.com
In reply to: eoghan (#1)
Re: createlang

Exit the psql prompt. Type the same command:

createlang plpgsql test

Then access your db:

psql test

And load your script:

\i test.sql

On Aug 15, 2005, at 4:45 PM, eoghan wrote:

Hello
Im trying to load plpgsql into my test db... Im wondering if theres a
way to check if its loaded... I do:
test-# createlang plpgsql test
test-#
When i try load an example function:
test-# \i test.sql
Im getting:
psql:test.sql:5: ERROR: language "plpgsql" does not exist
HINT: You need to use "createlang" to load the language into the
database.
Anyone any hints for me?
Thanks
Eoghan

---------------------------(end of
broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

-----
James Cradock, jcradock@me3.com

#4James Cradock
jcradock@me3.com
In reply to: eoghan (#1)
Re: createlang

Almost forgot:

http://www.postgresql.org/docs/8.0/interactive/app-createlang.html

I hope this and the prior reply help.

On Aug 15, 2005, at 4:45 PM, eoghan wrote:

Hello
Im trying to load plpgsql into my test db... Im wondering if theres a
way to check if its loaded... I do:
test-# createlang plpgsql test
test-#
When i try load an example function:
test-# \i test.sql
Im getting:
psql:test.sql:5: ERROR: language "plpgsql" does not exist
HINT: You need to use "createlang" to load the language into the
database.
Anyone any hints for me?
Thanks
Eoghan

---------------------------(end of
broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

-----
James Cradock, jcradock@me3.com

me3 Technology Consultants, LLC
24 Preble Street, 2nd Floor
Portland, ME 04101

207-772-3217 (office)
207-838-8678 (mobile)

www.me3.com

#5eoghan
postgres@redry.net
In reply to: Joshua D. Drake (#2)
Re: createlang

On 15 Aug 2005, at 21:58, Joshua D. Drake wrote:

eoghan wrote:

Hello
Im trying to load plpgsql into my test db... Im wondering if
theres a way to check if its loaded... I do:
test-# createlang plpgsql test

createlang is a command line client:

bash# createlang -U postgres -P 5432 plpgsql database

What you are looking for is:

CREATE LANGUAGE.

Thanks Joshua,
I was using createlang from the command line...
eoghan-js-Computer:~ postgres$ /opt/local/bin/psql test -U postgres
Welcome to psql 8.0.3, the PostgreSQL interactive terminal.
<etc>
test=# createlang plpgsql test

Or if loading .sql do you need the CREATE LANGUAGE in here?
Im new to this...
Thanks for you help
Eoghan

#6Sean Davis
sdavis2@mail.nih.gov
In reply to: eoghan (#1)
Re: createlang

On 8/15/05 4:45 PM, "eoghan" <postgres@redry.net> wrote:

Hello
Im trying to load plpgsql into my test db... Im wondering if theres a
way to check if its loaded... I do:
test-# createlang plpgsql test
test-#
When i try load an example function:
test-# \i test.sql
Im getting:
psql:test.sql:5: ERROR: language "plpgsql" does not exist
HINT: You need to use "createlang" to load the language into the
database.

You need to run creatlang from the command line (outside the database).
Here is the documentation:

http://www.postgresql.org/docs/8.0/interactive/app-createlang.html

Sean

#7eoghan
postgres@redry.net
In reply to: James Cradock (#4)
Re: createlang

On 15 Aug 2005, at 22:03, James Cradock wrote:

Almost forgot:

http://www.postgresql.org/docs/8.0/interactive/app-createlang.html

I hope this and the prior reply help.

On Aug 15, 2005, at 4:45 PM, eoghan wrote:

Hi James
Thanks! That got it...
Exit psql prompt and ran createlang...
Suppose seems obvious to me now :)
Thanks again
Eoghan