how can i get plpgsql in function?

Started by Muhammad Rusydialmost 25 years ago3 messagesgeneral
Jump to latest
#1Muhammad Rusydi
rusydi@cbn.net.id

Hi,
where can i get plpgsql?
when i try create function with 'plpqsql' as the language
i've got error that say my postgres does'nt supported plpgsql language?
i build my postgres with rpm method
is this the problem?
how can i solve this?

TIA
Didi

#2Muhammad Rusydi
rusydi@cbn.net.id
In reply to: Muhammad Rusydi (#1)
Re: how can i get plpgsql in function?

Hi John,

Try to do this...

SELECT * FROM pg_language ;

yes i've already done this

If you don't have plpgsql listed in there.. Then I would suggest that
you put it in the table...;-)

and yes i don't have it

via

CREATE PROCEDURAL LANGUAGE 'PL/PGSQL' or something..;-)

but there's an error when i do this one
parse error near ";" it says
would you or anyone here help me again?

TIA
Didi

#3Doug McNaught
doug@wireboard.com
In reply to: Muhammad Rusydi (#1)
Re: how can i get plpgsql in function?

"Muhammad Rusydi" <rusydi@cbn.net.id> writes:

CREATE PROCEDURAL LANGUAGE 'PL/PGSQL' or something..;-)

but there's an error when i do this one
parse error near ";" it says
would you or anyone here help me again?

Easiest way to do this is to use the 'createlang' shell script that
ships with Postgres:

$ createlang -d <dbname> plpgsql

If you do it to the 'template1' database, all other DBs created after
that will have PL/PGSQL available.

-Doug
--
The rain man gave me two cures; he said jump right in,
The first was Texas medicine--the second was just railroad gin,
And like a fool I mixed them, and it strangled up my mind,
Now people just get uglier, and I got no sense of time... --Dylan