Postgres PL/Python

Jorge Godoy godoy at ieee.org
Thu Sep 15 23:13:00 EDT 2005


Mike Meyer <mwm at mired.org> writes:

> Whether or not you use stored procedures is almost religious in
> nature. Google for "stored procedures", and you'll find opinions
> ranging from "never use them at all" to "use them whenever you
> possibly can."

Also there's the problem of performance.  If you can write an SQL function
(that's how PostgreSQL calls its stored procedures) instead of a Python
function, chances are that the query analyzer will be able to do a better job
optimizing it than with Python.

>From some talk on IRC with PostgreSQL people, I got the following impression
(in order of better performance to worse performance):

        - C
        - SQL
        - plpgsql
        - plpythonu

YMMV. 


Ah!  And I'm the one of "use them whenever you can" people. :-)  It reduces a
lot of code and make system less prone to errors when you have multiple
interfaces (besides making it easier to fix / add database logic).


Be seeing you,
-- 
Jorge Godoy      <godoy at ieee.org>



More information about the Python-list mailing list