plpython and trusted modules

Started by Steven D. Arnoldalmost 25 years ago2 messagesgeneral
Jump to latest
#1Steven D. Arnold
stevena@neosynapse.net

Hi,

From a plpython function, I'm trying to call a function in a module
that imports _pg (pygresql). When I do this, I get the following
error:

psql:/home/thoth/dev/data_model/tqse_test.sql:18: ERROR: plpython:
Call of function `__plpython_procedure_test_tqse_198863' failed.
exceptions.ImportError: untrusted dynamic module: _pg

I have added the plpython handler function to the database from which
the call is made with the following command:

create function plpython_call_handler() returns opaque as
'$libdir/plpython' language 'C';

I then added the plpython procedural language as UNTRUSTED, with the
command:

create procedural language 'plpython' handler
plpython_call_handler lancompiler 'PL/Python';

Why can't I get the stored procedure to execute this function? From
what I understand of the documentation, I'm doing everything right.
Any ideas? This is actually a very important problem for me, so any
help would be greatly appreciated.

----------------------------------------------------------------------
Steven D. Arnold stevena@neosynapse.net
AIM: abraxan ICQ: 73804392
~~~~~~~~~~~~~~~~~~~~~~~~ There is no spoon. ~~~~~~~~~~~~~~~~~~~~~~~~

#2Peter Eisentraut
peter_e@gmx.net
In reply to: Steven D. Arnold (#1)
Re: plpython and trusted modules

Steven D. Arnold writes:

Why can't I get the stored procedure to execute this function?

Because, as you correctly figured, it's untrusted. If you want to invest
some coding time you can create an "untrusted" PL/Python (not by merely
declaring it untrusted, mind you), but so far there isn't one.

--
Peter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter