Thread: installing Procedural Language PL/PGSQL

installing Procedural Language PL/PGSQL

From
"Steve SAUTETNER"
Date:
hello !

I tried to create plpgsql functions, but this language seems not to be
installed.

How can i install it ?

I think i must use "CREATE LANGUAGE" but i don't know how to use it.

Have a good day !


Re: installing Procedural Language PL/PGSQL

From
"Richard Huxton"
Date:
From: "Steve SAUTETNER" <ssa@informactis.com>

> I tried to create plpgsql functions, but this language seems not to be
> installed.
>
> I think i must use "CREATE LANGUAGE" but i don't know how to use it.

Try the "createlang" command-line tool:

createlang plpgsql mydbname

HTH

- Richard Huxton


Re: installing Procedural Language PL/PGSQL

From
Bryan Cross
Date:
Hi Steve,

I was able to successfully install and used PLPGSQL by using the createlang
utility, which was installed as part of my postgres installation.  Bruce
Momjian's book, PostgreSQL: Introduction and Concepts, has a good
description of how to use this on page 208.

Basically, the syntax (from a shell prompt, _not_ within psql), is:

createlang plpgsql <dbname>

where dbname is the name of the database you want to be able to use plpgsql
with.

Of course, you must be logged in as someone with sufficient privilages to
do this ;)

If your PATH and other environment variables aren't set up correctly the
createlang utility might have trouble finding the relevant shared library:
plpgsql.so.

Anyway, let me know how it works out for you!

Bryan

Steve SAUTETNER wrote:

> hello !
>
> I tried to create plpgsql functions, but this language seems not to be
> installed.
>
> How can i install it ?
>
> I think i must use "CREATE LANGUAGE" but i don't know how to use it.
>
> Have a good day !
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html