dbTalk Databases Forums  

[BUGS] plperl problems with DBD::PgSPI

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] plperl problems with DBD::PgSPI in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Michael Fuhr
 
Posts: n/a

Default [BUGS] plperl problems with DBD::PgSPI - 12-06-2004 , 01:15 AM






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/

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.