Re: BUG #1831: plperl gives error after reconnect.

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Greg Sabino Mullane <greg(at)turnstep(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1831: plperl gives error after reconnect.
Date: 2005-08-20 03:17:30
Message-ID: 20050820031730.GA21051@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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::mksafefunc called at (eval 7) line 2. at (eval 7) line 2.

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

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

--
Michael Fuhr

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2005-08-20 04:03:46 Re: BUG #1831: plperl gives error after reconnect.
Previous Message Michael Fuhr 2005-08-20 03:03:48 Re: BUG #1831: plperl gives error after reconnect.