On Fri, Jul 23, 2010 at 10:17, Milen <mile@avangardsolutions.com> wrote:
>
> The following bug has been logged online:
>
> Bug reference: =C2=A0 =C2=A0 =C2=A05570
> Logged by: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Milen
> Email address: =C2=A0 =C2=A0 =C2=A0mile@avangardsolutions.com
> PostgreSQL version: v9.0beta2
> Operating system: =C2=A0 Linux
> Description: =C2=A0 =C2=A0 =C2=A0 =C2=A0global hash %_SHARED does not wor=
k in the new version
> Details:
>
> Hello,
> We can't find the global hash %_SHARED in the new version of plperl.c.
Huh, can we get more info? are you using plperl or plperlu? A
complete testcase would also help.
It works for me:
=3D> SELECT version();
version
---------------------------------------------------------------------------=
-------------------------------------
PostgreSQL 9.0beta3 on x86_64-unknown-linux-gnu, compiled by GCC gcc
(GCC) 4.5.0 20100610 (prerelease), 64-bit
=3D> create or replace function perl_shared() returns void as $$
elog(INFO, $_SHARED{'stuff'});
$_SHARED{'stuff'} =3D '1';
for my $k (keys %_SHARED)
{
elog(INFO, $k);
}
$$ language plperl;
=3D> select perl_shared();
INFO:
CONTEXT: PL/Perl function "perl_shared"
INFO: stuff
CONTEXT: PL/Perl function "perl_shared"
perl_shared
-------------
(1 row)
=3D> select perl_shared();
INFO: 1
CONTEXT: PL/Perl function "perl_shared"
INFO: stuff
CONTEXT: PL/Perl function "perl_shared"
perl_shared
-------------
(1 row)