Thread: how can i get plpgsql in function?

how can i get plpgsql in function?

From
"Muhammad Rusydi"
Date:
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


Re: how can i get plpgsql in function?

From
"Muhammad Rusydi"
Date:
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


Re: how can i get plpgsql in function?

From
Doug McNaught
Date:
"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