On Wed, Aug 17, 2005 at 11:37:58PM -0600, Michael Fuhr wrote:
> With HEAD on Solaris 9/sparc I don't have to reconnect before the
> SELECT to get the error (I tested both ways, with and without a
> reconnect, and it made no difference).
> I get the same results on FreeBSD 4.11-STABLE/x86 but I have to
> reconnect before the SELECT to get the error.
I discovered why these systems behaved differently: the Solaris box
didn't have validator functions for plperl/plperlu. Apparently I
had createlang'ed them before the validator function was added a
couple of months ago:
http://archives.postgresql.org/pgsql-committers/2005-06/msg00322.php
I dropped and recreated plperl and plperlu on the Solaris box and
now I do have to reconnect to get the error.
Here's a summary of what I see on both systems:
* The functions are foo() and bar(), both created as plperl.
bar() calls foo() using spi_exec_query().
* In HEAD, where plperl has a validator, if I create the functions
and call bar() in the same session, it works. If I reconnect and
call bar() then I get the error.
* In 8.0.3, where plperl has no validator, if I create the functions
and call bar() in the same session, I get the error. Likewise if
I reconnect.
* In either version, if bar() is plperlu then I don't get the error,
regardless of whether I've reconnected since creating the functions.
Creating foo() as plperlu has no effect other than changing the
undefined subroutine's name to mkunsafefunc.
Something about the calling function being plperlu and something
the validator does appear to be relevant, at least on my two systems.
--
Michael Fuhr