Re: plperl and table/record access

From: Gordan Bobic <gordan(at)bobich(dot)net>
To: Alex Pilosov <alex(at)pilosoft(dot)com>
Cc: psql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: plperl and table/record access
Date: 2001-10-24 21:37:17
Message-ID: 200110242137.f9OLbJM11232@sentinel.bobich.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thank you for the reply.

I seem to be having some difficulty with this module.

1) It doesn't install in the default RPM setup where the main PostgreSQL root
directory doesn't exist as such. The Makefile.PL expects the include and
libpq directories to all be under one directory, which isn't the case. I have
worked around this by making a /usr/local/postgresql directory and linking
the required directories into it, and then exporting POSTGRES_HOME to this
directory.

However, I then get the following error upon installation:

gcc -c -I/usr/local/postgresql/include -I/usr/local/postgresql/backend
-I/usr/local/postgresql/interfaces/libpq
-I/usr/lib/perl5/site_perl/5.6.0/i386-linux/auto/DBI -fno-strict-aliasing -g
-DVERSION=\"0.01\" -DXS_VERSION=\"0.01\" -fPIC
-I/usr/lib/perl5/5.6.0/i386-linux/CORE PgSPI.c
In file included from
/usr/lib/perl5/site_perl/5.6.0/i386-linux/auto/DBI/DBIXS.h:19,
from PgSPI.h:21,
from PgSPI.xs:14:
/usr/lib/perl5/5.6.0/i386-linux/CORE/perl.h:3205: redefinition of `union
semun'
make: *** [PgSPI.o] Error 1

What am I doing wrong?

Regards.

Gordan

On Wednesday 24 Oct 2001 18:25, Alex Pilosov wrote:
> See DBD::PgSPI on CPAN, or www.formenos.org/PgSPI
>
> Example:
> create function dbd_pgspi_test() returns varchar as '
> use DBD::PgSPI;
> my @ar=$pg_dbh->selectrow_array(''select current_user'');
> return $ar[0];
> ' language 'plperlu';
>
> Currently, it does not support triggers. (Well, it supports triggers, but
> there's no way to access trigger arguments).
>
> On Wed, 24 Oct 2001, Gordan Bobic wrote:
> > Hi.
> >
> > How do I manipulate data in tables from within plperl? Can I, for
> > example, issue SQL statements from within plperl functions? I haven't
> > managed to find any documentation on this subject. Can anyone point me in
> > the correct direction, please? I'm trying to write some trigger
> > functions...
> >
> > I have seen an example with the plperl function that performs a
> > calculation on each row of a table, but it is not explained anywhere how
> > to insert records, or how to locate specific records without having to
> > loop through the entire database. I presume that DBI will not work, given
> > the need for setting up separate database connections, authentication,
> > etc.
> >
> > Thanks.
> >
> > Gordan
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 2: you can get off all lists at once with the unregister command
> > (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Guy Fraser 2001-10-24 21:39:36 Re: WWW interface for postgres
Previous Message Doug McNaught 2001-10-24 21:30:15 Re: Function won't compile