Re: adding import in pl/python function - Mailing list pgsql-hackers

From Szymon Guz
Subject Re: adding import in pl/python function
Date
Msg-id CAFjNrYvzrvDyF5RRYU1Y1mf_5ah5=MS7Kp0MasAPFgGpMGMAWg@mail.gmail.com
Whole thread Raw
In response to Re: adding import in pl/python function  (Claudio Freire <klaussfreire@gmail.com>)
Responses Re: adding import in pl/python function  (Claudio Freire <klaussfreire@gmail.com>)
List pgsql-hackers
<div dir="ltr"><br /><div class="gmail_extra"><div class="gmail_quote">On 24 May 2013 21:14, Claudio Freire <span
dir="ltr"><<ahref="mailto:klaussfreire@gmail.com" target="_blank">klaussfreire@gmail.com</a>></span> wrote:<br
/><blockquoteclass="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div
class="im">OnFri, May 24, 2013 at 4:10 PM, Szymon Guz <<a
href="mailto:mabewlun@gmail.com">mabewlun@gmail.com</a>>wrote:<br /> ><br /> > I'm thinking about something
else.We could convert it into Decimal<br /> > (<a href="http://docs.python.org/2/library/decimal.html"
target="_blank">http://docs.python.org/2/library/decimal.html</a>)class in Python.<br /> > Unfortunately this class
requiresimport like `from decimal import Decimal`<br /> > from a standard Python library.<br /> ><br /> > I'm
wonderingif it would be a good idea to do it like this. It shouldn't<br /> > fail even with the trusted version of
pl/python,as I'd rather see the<br /> > trusted version to allow importing packages from standard library.<br /><br
/><br/></div>Why would passing a decimal require an import?<br /><br /> The extension itself needs a reference to
Decimal,to build them, but<br /> the procedure's context doesn't need to have it.<br /></blockquote></div><br
/></div><divclass="gmail_extra" style="style">Hm... maybe you're right. I think I don't understand fully how the
proceduresare executed, and I need to read more to get it.</div><div class="gmail_extra" style="style"><br /></div><div
class="gmail_extra"style="style"><br /></div><div class="gmail_extra" style="style">thanks,</div><div
class="gmail_extra"style="style">Szymon</div></div> 

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: shmem startup and shutdown hooks
Next
From: Andres Freund
Date:
Subject: Re: visibilitymap_set and checksums