stvn has asked for the wisdom of the Perl Monks concerning the following question:

I have been looking at PostgreSQL as an "upgrade" from MySQL for a reporting application we are currently working on. One of the reasons for switching to Postgres would be take advantage of stored procedures. I have heard about PL/Perl, but I cannot seem to find anything other than documentation on it when I search Google. Is there anyone out there who has used it? Any opinions would be much appreciated.

-stvn

Replies are listed 'Best First'.
Re: PostgreSQL and PL/Perl
by ctilmes (Vicar) on Aug 11, 2004 at 23:32 UTC
    My advice -- stick with PL/PgSQL for now... With the new v 8.0 (now in beta) PL/Perl will get much better.

    Update: PL/PgSQL, not PL/SQL.

      Don't you mean PL/pgSQL ?
Re: PostgreSQL and PL/Perl
by calin (Deacon) on Aug 12, 2004 at 19:09 UTC

    PostgreSQL 8.0 (now in beta) is advertised to come with a revamped, "next generation" PLPerl:

    New Perl Server-Side Language

    A new version of the plperl server-side language now supports a persistent shared storage area, triggers, returning records and arrays of records, and SPI calls to access the database.

    Little documentation yet - the project is in need of documentation writers - but from a quick read of the sample file plperl-test.sql it looks like the interface is simple and intuitive. The projects is in need of more hands and general beefing-up, though.

Re: PostgreSQL and PL/Perl
by zby (Vicar) on Aug 12, 2004 at 10:08 UTC
    I have tried it two years ago. It had many severe limitations, but was usefull as an addition PL/pgSQL for manipulating text. The main limitation is that you cannot use your database tables directly in your Perl subroutines. Second was that using libraries broke the security model. But that was 2 years ago - so it might have changed.

    Update: I read the linked PL/Perl documentation and indeed the situation looks much better than two years ago with the experimental DBI::PgSPI solving the first issue and more convenient use of plperlu for the second. I can see much potential in this kind of database programming, and perhaps when more people start to use it it shell become less 'experimental'.

Re: PostgreSQL and PL/Perl
by drfrog (Deacon) on Aug 12, 2004 at 22:38 UTC
    yah ive used it, in fact i was one of the people to suggest putting it in to PostGres ;)

    that said it doesnt have access to modules and there are some other problems,

    that siad if you need to do some quick and dirty regex's on some postgres info then its all goood

    i dont know where my old code is, if i find something ill pass it along