Re: Is it possible to call other functions inside plpythonu? - Mailing list pgsql-general

From Stuart Bishop
Subject Re: Is it possible to call other functions inside plpythonu?
Date
Msg-id CADmi=6Me6qVGUq-jvw0PHDM6Bq6nbaPpxAKmfGf8i3BVBybJfg@mail.gmail.com
Whole thread Raw
In response to Is it possible to call other functions inside plpythonu?  (Frank Lanitz <frank@frank.uvena.de>)
Responses Re: Is it possible to call other functions inside plpythonu?
List pgsql-general
On Fri, Apr 27, 2012 at 4:42 PM, Frank Lanitz <frank@frank.uvena.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.

There is overhead transforming data to and from types that the Python
interpreter can work with. How much overhead is rather subjective - we
find it fast enough for the things we use it for. The Python syntax
can become a bit cumbersome if you need to interact with the database
a lot, in which case plpgSQL is likely the better language for that
job. There are counter examples too, where the Python code is much
cleaner and in some cases lets you do things impossible in plpgSQL.
Access to the Python standard library gives you a great toolkit, and
it being 'unsafe' you can do stuff you would otherwise need to write
and deploy C extensions for.

--
Stuart Bishop <stuart@stuartbishop.net>
http://www.stuartbishop.net/

pgsql-general by date:

Previous
From: "Albe Laurenz"
Date:
Subject: Re: spanish locale question
Next
From: Stuart Bishop
Date:
Subject: Re: Is it possible to call other functions inside plpythonu?