try:
frbn=# \h create language
Command: CREATE LANGUAGE
Description: Defines a new language for functions
Syntax:
CREATE [ TRUSTED ] [ PROCEDURAL ] LANGUAGE 'langname'
HANDLER call_handler
LANCOMPILER 'comment'
---
but,
"A handler must already exist for the language in question
when you use the CREATE LANGUAGE command. " (cf online "practical postgresql")
find where your plpgsql.so lib is located (mine is in /usr/lib/pgsql):
---
CREATE FUNCTION "plpgsql_call_handler" () RETURNS opaque
AS '/usr/lib/pgsql/plpgsql.so', 'plpgsql_call_handler' LANGUAGE 'C';
---
but the shell command "createlang" is easier to use.
Cindy wrote:
> Tino Wildenhain writes:
>
> >> I'm looking at, it says that you must issue a
> >> createlang plperl <dbname>
> >> in order to make use of this in a particular database. Does this
> >> need to be done prior to populating the database, or can it be done
> >> any time subsequent?
> >
> >This can be done any time. And you dont have to stuck with perl,
> >even python (plpython) is a choice :)
>
> OK. I'm actually using 7.0.3 (it's supposed to be updated Real Soon Now),
> and the documentation:
> http://www.us.postgresql.org/users-lounge/docs/7.0/user/app-createlang.htm
> doesn't seem to be helping:
>
> Text=# createlang -l;
> ERROR: parser: parse error at or near "createlang"
> Text=# createlang Text -l;
> ERROR: parser: parse error at or near "createlang"
> Text=# createlang plperl;
> ERROR: parser: parse error at or near "createlang"
> Text=# createlang 'plperl' Text;
> ERROR: parser: parse error at or near "createlang"
> Text=# createlang plperl Text;
> ERROR: parser: parse error at or near "createlang"
> Text=#
>
> ack!
>
> The options used for compiling this were (see below).
>
> I also tried it on our 7.2 installation:
>
> Text=# createlang plperl;
> ERROR: parser: parse error at or near "createlang"
> Text=# createlang 'plperl';
> ERROR: parser: parse error at or near "createlang"