Re: Access disk from plpython

From: Craig Ringer <craig(at)2ndQuadrant(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
Cc: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, "Rhys A(dot)D(dot) Stewart" <rhys(dot)stewart(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Access disk from plpython
Date: 2012-11-15 01:21:21
Message-ID: 50A44391.7030905@2ndQuadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 11/15/2012 01:08 AM, Adrian Klaver wrote:
> On 11/14/2012 09:03 AM, Jeff Janes wrote:
>> On Wed, Nov 14, 2012 at 8:44 AM, Rhys A.D. Stewart
>> <rhys(dot)stewart(at)gmail(dot)com> wrote:
>>> Greetings all,
>>>
>>> having a permission issue with writing a file using plpython to a local
>>> folder, changed permissions to everyone read and write and even
>>> changed the
>>> owner to postgres. but no joy, any suggestions?
>>
>> plpython is a "trusted" langauge. That means pgsql trusts it not to
>> allow you to break out of the sandbox and interact directly with the
>> file system or the database server internals.
>>
>> If you need to do those things, you can use plpythonu.
>
> My understanding is that of Postgres 7.4 plpython does not exist. In
> other words only the untrusted version is available.

... and that's because Python's design - in particular, the
introspection features - means the the restricted mode wasn't
particularly restricted. See
http://docs.python.org/2/library/restricted.html ,
http://wiki.python.org/moin/SandboxedPython .

--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2012-11-15 01:24:51 Re: Using Postgresql 9.2 on windows 7 and windows vista
Previous Message Toby Corkindale 2012-11-15 00:40:58 Re: SSDs - SandForce or not?