Обсуждение: SQL from PLPerl

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

SQL from PLPerl

От
Systems Administrator
Дата:
    Hi all.  Another question -- I'm using plperl, and I was wondering
what the best way to do a SELECT in it is.  Am I best off using DBI and
having the plperl connect to the database again?  Or is there some other
way to do it?

    Thanks,

--
Tim Nelson
Systems Administrator
Sunet Internet
Tel: +61 3 5241 1155
Fax: +61 3 5241 6187
Web: http://www.sunet.com.au/
Email: sysadmin@sunet.com.au



Re: SQL from PLPerl

От
Josh Berkus
Дата:
Tim,

> Hi all.  Another question -- I'm using plperl, and I was wondering
> what the best way to do a SELECT in it is.  Am I best off using DBI and
> having the plperl connect to the database again?  Or is there some other
> way to do it?

There is currently no good way to do this in PL/perl.

PL/pgSQL, C, and I believe PL/Tcl can interact with the database.  No other PL
at this time can.   Hopefully this will change in the future.

--
-Josh Berkus
 Aglio Database Solutions
 San Francisco


Re: SQL from PLPerl

От
Joe Conway
Дата:
Josh Berkus wrote:
> PL/pgSQL, C, and I believe PL/Tcl can interact with the database.  No other PL
> at this time can.   Hopefully this will change in the future.

PL/R can:
http://www.joeconway.com/plr/doc/plr-spi-rsupport-funcs.html

So can PL/Python:
http://www.postgresql.org/docs/view.php?version=7.3&idoc=0&file=plpython-database.html

Joe


Re: SQL from PLPerl

От
Sebastian Riedel
Дата:
Hi,

There is DBD::PgSPI:
http://search.cpan.org/~apilos/DBD-PgSPI-0.01/

I was told that it works fine on linux with non-threaded perl,
but until now i had no chance to test it.

On Mac OS X with threaded perl 5.8.1 it seems not to work. :(

Cheers,
Sebastian Riedel

Joe Conway wrote:

> Josh Berkus wrote:
>> PL/pgSQL, C, and I believe PL/Tcl can interact with the database.  No
>> other PL at this time can.   Hopefully this will change in the >> future.
>
> PL/R can:
> http://www.joeconway.com/plr/doc/plr-spi-rsupport-funcs.html
>
> So can PL/Python:
> http://www.postgresql.org/docs/
> view.php?version=7.3&idoc=0&file=plpython-database.html
>
> Joe
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 8: explain analyze is your friend
>