Re: BUG #1831: plperl gives error after reconnect. - Mailing list pgsql-bugs

From Michael Fuhr
Subject Re: BUG #1831: plperl gives error after reconnect.
Date
Msg-id 20050820031730.GA21051@winnie.fuhr.org
Whole thread Raw
In response to Re: BUG #1831: plperl gives error after reconnect.  (Michael Fuhr <mike@fuhr.org>)
Responses Re: BUG #1831: plperl gives error after reconnect.
Re: BUG #1831: plperl gives error after reconnect.
List pgsql-bugs
On Fri, Aug 19, 2005 at 09:03:48PM -0600, Michael Fuhr wrote:
> Here's a summary of what I see on both systems:

I mentioned this before but forgot to include it in the summary:

* If I execute "SELECT foo()" before I execute "SELECT bar()" then
  I don't get the error.

Here's my current test case, run in HEAD in a database named "test"
that has plperl:

CREATE FUNCTION foo() RETURNS text AS $$
return "foo";
$$ LANGUAGE plperl;

CREATE FUNCTION bar() RETURNS text AS $$
my $rv = spi_exec_query("SELECT foo($_[0])");
return $rv->{rows}[0]->{foo};
$$ LANGUAGE plperl;

SELECT bar();
 bar
-----
 foo
(1 row)

\c test
You are now connected to database "test".

SELECT bar();
ERROR:  error from Perl function: creation of Perl function failed:     (in cleanup) Undefined subroutine
&main::mksafefunccalled at (eval 7) line 2. at (eval 7) line 2. 

SELECT foo();
 foo
-----
 foo
(1 row)

SELECT bar();
 bar
-----
 foo
(1 row)

--
Michael Fuhr

pgsql-bugs by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: BUG #1831: plperl gives error after reconnect.
Next
From: Tom Lane
Date:
Subject: Re: BUG #1831: plperl gives error after reconnect.