plperl.on_init - bug or just me? - Mailing list pgsql-hackers

From Richard Huxton
Subject plperl.on_init - bug or just me?
Date
Msg-id 4B865880.5060404@archonet.com
Whole thread Raw
Responses Re: plperl.on_init - bug or just me?
List pgsql-hackers
 From memory and the thread below, I thought one of the key uses was to 
let me use a module from trusted plperl.  http://archives.postgresql.org/pgsql-hackers/2010-02/msg00167.php

The example below has a TestModule that just exports one sub - visible 
from plerlu but not plperl. Presumably "Safe" just clamps down and my 
sub isn't marked as acceptable. Is this intended, or am I doing 
something stupid?

postgresql.conf:
plperl.on_init =
'use lib "/home/richardh/dev/"; use TestModule qw(add_one);'

-- tries to call TestModule::add_one
richardh=# SELECT add_one(1);
ERROR:  Undefined subroutine &TestModule::add_one called at line 1.
CONTEXT:  PL/Perl function "add_one"

-- tries to call the exported main::add_one
richardh=# SELECT add_one_e(1);
ERROR:  Undefined subroutine &main::add_one called at line 1.
CONTEXT:  PL/Perl function "add_one_e"

-- plperlu - TestModule::add_one
richardh=# SELECT add_one_u(1); add_one_u
-----------         2
(1 row)


--   Richard Huxton  Archonet Ltd


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: pg_stop_backup does not complete
Next
From: Andrew Dunstan
Date:
Subject: Re: plperl.on_init - bug or just me?