Обсуждение: A couple of pgsql questions

Поиск
Список
Период
Сортировка

A couple of pgsql questions

От
Jack V Chung
Дата:
Hello,

I want to apologize in advance if I sent this to the wrong mailing list.

I'm was trying out the example functions using TCL, but for function
was not created.  Here's the error:


db=# CREATE FUNCTION tcl_max (int4, int4) RETURNS int4 AS '
    if {$1 > $2} {return $1}
    return $2
' LANGUAGE 'pltcl';
db'# physionetdb'# physionetdb'# ERROR:  Unrecognized language specified in
    a CREATE FUNCTION: 'pltcl'.  Recognized languages are sql, C, internal
    and the created procedural languages.


Here is my current version:


db=# select version();
                               version
---------------------------------------------------------------------
 PostgreSQL 7.0.2 on i686-pc-linux-gnu, compiled by gcc egcs-2.91.66




I used the RPM to installed all the files including
postgresql-tk-7.0.2-2.i386.rp and postgresql-tcl-7.0.2-2.i386.rpm

Can someone assist me?




Another question, can someone point me to documentation that explains how
to wrap a few insert statments in a transaction?


thanks a lot
jack

Re: A couple of pgsql questions

От
Stephan Szabo
Дата:
You need to use the createlang script to enable the
procedural languages you wish to use.
I believe it's createlang <language> <database>

> db'# physionetdb'# physionetdb'# ERROR:  Unrecognized language specified in
>     a CREATE FUNCTION: 'pltcl'.  Recognized languages are sql, C, internal
>     and the created procedural languages.
...
> I used the RPM to installed all the files including
> postgresql-tk-7.0.2-2.i386.rp and postgresql-tcl-7.0.2-2.i386.rpm
>
> Can someone assist me?