Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Any decent tutorials for PlPerl?

1 view
Skip to first unread message

Mladen Gogala

unread,
Nov 6, 2009, 11:35:28 AM11/6/09
to
I have problems with installing DBD::PgSPI. The module is old and is
looking for $POSTGRES_HOME/include. There is no such thing on either Red
Hat or Ubuntu 9.04. Postgres version is 8.3.8. I'd like to learn how can I
use modules like Date::Simple or MIME::Lite from plgperl. I would be very
grateful if someone knows a good tutorial for plpgperl. The documentation
is really bad.

--
http://mgogala.freehostia.com

Laurenz Albe

unread,
Nov 9, 2009, 3:27:06 AM11/9/09
to

I may be wrong, but looking at the documentation of DBD::PgSPI I get
the impression that its only use is to access the database in
which the function is running.

That would explain the age and the condition of it - you don't need
it at all.

All you need are the spi_* functions, see
http://www.postgresql.org/docs/current/static/plperl-database.html

As far as I know, you can simply add a "use" statement in your
function body to use a module. The module needs to be installed in
the Perl against which PostgreSQL is linked.

I don't use PL/Perl much, so I don't know of a good tutorial.
There are some code snippets on the Wiki:
http://wiki.postgresql.org/wiki/Category:PL/Perl

Yours,
Laurenz Albe


Jochen Lutz

unread,
Nov 12, 2009, 6:35:11 PM11/12/09
to
Laurenz Albe <inv...@spam.to.invalid> wrote:
> I may be wrong, but looking at the documentation of DBD::PgSPI I get
> the impression that its only use is to access the database in
> which the function is running.

This ist exactly the use of DBD::PgSPI - and doing so in the usual way
you access databases in perl.

> That would explain the age and the condition of it - you don't need
> it at all.
>
> All you need are the spi_* functions, see
> http://www.postgresql.org/docs/current/static/plperl-database.html

DBD::PgSPI is just a wrapper around these functions. As this functions
didn't change, there's no need to change DBD::PgSPI.

As a hint to the OPs problem: this is a perl build problem, try to fix
the Makefile.pl and point it to the postgres include directory.


Jochen

0 new messages