Re: plperl and table/record access - Mailing list pgsql-general

From Alex Pilosov
Subject Re: plperl and table/record access
Date
Msg-id Pine.BSO.4.10.10110241323220.9836-100000@spider.pilosoft.com
Whole thread Raw
In response to plperl and table/record access  (Gordan Bobic <gordan@bobich.net>)
Responses Re: plperl and table/record access  (Gordan Bobic <gordan@bobich.net>)
List pgsql-general
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@postgresql.org)
>
>


pgsql-general by date:

Previous
From: qk22@gmx.co.uk (qk22)
Date:
Subject: Re: Can not input large text data
Next
From: Tom Lane
Date:
Subject: Re: index files still growing