James William Pye wrote:
> On Sat, Feb 25, 2006 at 10:09:52AM +0100, Tino Wildenhain wrote:
> > And with even more love the restricted python from zope could
> > be ported so there could be a pl/python again :-)
> >
> > Ok, just haluzinating ;)
>
> Not necessarily. ;)
>
> From what I have seen of zope's restricted python, it does, or can, force its
> restrictions by checking bytecode. I imagine a simple PL sitting on top of the
> untrusted varient that merely implements a custom validator that checks the
> bytecode produced by the untrusted PL's validator.
I'm not sure it's an issue now that we have pg_pltemplate, but in older
versions it's possible to create a language without setting a validator.
This would make the validator an unsuitable place for checking the
restrictions. But the call handler can access the bytecode just the
same, so it's just a matter of moving the checks there, just before the
execution.
--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support