Re: Is it possible to call other functions inside plpythonu?

From: Stuart Bishop <stuart(at)stuartbishop(dot)net>
To: Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Is it possible to call other functions inside plpythonu?
Date: 2012-05-04 09:17:11
Message-ID: CADmi=6PaSeCihGXpH8GcfJatxc5zjO+H2wns2A1kpoUGy18e1g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, May 4, 2012 at 4:09 PM, Stuart Bishop <stuart(at)stuartbishop(dot)net> wrote:
> On Fri, Apr 27, 2012 at 4:42 PM, Frank Lanitz <frank(at)frank(dot)uvena(dot)de> wrote:
>> Hi folks,
>>
>> Just looking for a nice server side solution to implement some
>> fundamental logic for an application. plpythonu looks in this tmers very
>> well as I'm liking the syntax of Python. However, an very old blog post
>> at [1] made me unsure whether really to use it. Is it still (or has it
>> ever been) an issue that plpythonu is having a lot of overhead and not
>> able to make use of other functions? Didn't found anything on docu for
>> 9.1 about that.

I forgot to mention that you can (and always have been able to) call
other functions using plpy.execute("SELECT some_func()"). If you need
to invoke Python functions, you can also just 'import' the module like
any other Python code and avoid the overheads of converting data too
and from PostgreSQL data types. You may need to ensure the PYTHONPATH
environment variable gets set correctly if you need to import your own
code from the filesystem rather than the standard library.

--
Stuart Bishop <stuart(at)stuartbishop(dot)net>
http://www.stuartbishop.net/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Siva Palanisamy 2012-05-04 10:01:59 Re: How to get the physical locations of tables, views, functions etc of Postgresql in Windows & Linux?
Previous Message Stuart Bishop 2012-05-04 09:09:20 Re: Is it possible to call other functions inside plpythonu?