Re: Install new perl test function in PostgreSQL

From: Jignesh Shah <jignesh(dot)shah1980(at)gmail(dot)com>
To: Jure Kobal <j(dot)kobal(at)gmx(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Install new perl test function in PostgreSQL
Date: 2009-08-26 05:06:17
Message-ID: c11950270908252206g6429c772i26618bacc9ec1b4@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Thanks Jure. I have already plperl installed because I could see that many
new perl functions have been installed but I don't know where it plperl
installed. Could you tell me if there is any way to find out where it is
installed? Morever, if I get the location plperl install location, how to
insert/install my perl function? Is there any command available for this. My
questions might be silly but this is first time I am using PostgreSQL.

Thanks for being there.
Jignesh

On Tue, Aug 25, 2009 at 11:24 PM, Jure Kobal <j(dot)kobal(at)gmx(dot)com> wrote:

> First you need to install plperl into your database if you haven't already.
>
> createlang -h <host> -p <port> -U <user> plperl <db_name>
>
> -h, -p aren't really needed if you work on the box where postgres is
> installed.
>
> After that you just insert/install the function into the database where you
> have
> installed plperl and it should work via select <function_name>.
>
> --
> Regards,
> Jure Kobal
>
>
> On Tuesday 25 of August 2009 19:01:44 Jignesh Shah wrote:
> > Hi,
> >
> > I have taken below perl example form PostgreSQL documentation Chapter:
> 40.1
> >
> > CREATE FUNCTION perl_max (integer, integer) RETURNS integer AS $$
> > if ($_[0] > $_[1]) { return $_[0]; }
> > return $_[1];
> > $$ LANGUAGE plperl;
> >
> > I understood everything but I don't know how to integrate/install this
> new
> > function with PostgreSQL so that when I run "select perl_max(1,2)" query,
> > it returns 2. I have PostgreSQL install on one of my UNIX Server and has
> > root privileges. Please help me to install this function.
> >
> > Thanks,
> > Jignesh
>
>

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Jignesh Shah 2009-08-26 06:33:01 Writting Trigger for Truncate event
Previous Message Jana Vasseru 2009-08-25 21:49:17 Re: Number of rows