plperl problems with DBD::PgSPI

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: pgsql-bugs(at)postgresql(dot)org
Subject: plperl problems with DBD::PgSPI
Date: 2004-12-06 07:08:31
Message-ID: 20041206070831.GA49497@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

PostgreSQL 8.0.0rc1
DBD::PgSPI 0.02
Perl 5.8.6
FreeBSD 4.10-STABLE, Solaris 9

More error handling problems with plperl -- this time when using
DBD::PgSPI. If a function executes a query that raises an error,
subsequent functions that haven't been loaded yet will fail. I
think this problem got fixed for code that uses spi_exec_query().

CREATE OR REPLACE FUNCTION test1() RETURNS TEXT AS $$
use DBD::PgSPI;
my @v = $pg_dbh->selectrow_array("SELECT syntax_error");
return $v[0];
$$ LANGUAGE plperlu;

CREATE OR REPLACE FUNCTION test2() RETURNS TEXT AS $$
use DBD::PgSPI;
my @v = $pg_dbh->selectrow_array("SELECT 'this works'");
return $v[0];
$$ LANGUAGE plperlu;

SELECT test1();
ERROR: column "syntax_error" does not exist
CONTEXT: SQL statement "SELECT syntax_error"

SELECT test2();
ERROR: creation of Perl function failed: (in cleanup) Undefined subroutine &DBD::_::db::mkunsafefunc called at /usr/local/lib/perl5/site_perl/5.8.6/i386-freebsd/DBI.pm line 1529.

LOAD 'plperl'; -- or reconnect
SELECT test2();
test2
------------
this works
(1 row)

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

Browse pgsql-bugs by date

  From Date Subject
Next Message PostgreSQL Bugs List 2004-12-06 10:44:32 BUG #1339: enable to init database cluster
Previous Message Neil Conway 2004-12-06 01:12:04 Re: BUG #1337: Problem running PostgreSQL as service, incl.