Re: Confusion over Python drivers

From: Greg Smith <greg(at)2ndquadrant(dot)com>
To: Marko Kreen <markokr(at)gmail(dot)com>
Cc: Josh Berkus <josh(at)agliodbs(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Tim Bunce <Tim(dot)Bunce(at)pobox(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Confusion over Python drivers
Date: 2010-02-06 22:38:37
Message-ID: 4B6DEF6D.1030908@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Marko Kreen wrote:
> The pg8000 / bpgsql seem to be toy projects, and anyway you dont
> want to use pure-Python drivers in high-performance environments.
> We are not talking about C#/java here.
>

Right, and the comments from James reinforce this general idea: there
is little value to the people who most want Python+PostgreSQL support in
working on any of the pure Python implementations, because best case
performance is still half or less of the ones that more directly wrap
libpq. Even the best case with psycopg is enough of a performance hit
as it is.

> py-postgresql seems to be more serious, but as it's python3 only
> which makes it irrelevant today.
>

Also true.

> Psycopg was the leader, especially in web-environments,
> but it has non-obvious license and with dead website it does not
> seem that attractive. Although it is well-maintained still.
> Best path forward would be to talk with Psycopg guys about
> license clarification/change.
>

Agreed. A relicensed Psycopg, with a more professional looking
introduction/documentation page (like the budding page on our Wiki) than
what the initd web site has, seems like the best platform to hack on top
of to me as well. The fact that they've moved to git recently makes it
that much easier for another branch to exist even outside of their
somewhat troubled infrastructure.

To summarize what I saw on this thread, the primary wishlist of changes
to it are:

-License change
-Consider refactoring to better follow standard driver practices, such
as using PQExecParams
-Improvement in transaction control to resolve issues that cause idle
transactions
-Possible simplifications in how it's implemented async operations, to
improve robustness/reduce code complexity
-Confirm/add multi-threaded support
-Confirm/add support for the most common standard types (such as array)

> PyGreSQL is the oldest, older than DB-API, and so it's DB-API
> interface seems an afterthought and is untested/underused - eg.
> it does not support bytea.
>
And if Psycopg can't be relicensed happily and/or improved as above, as
the only other native Python driver PyGreSQL looks like the next
candidate to build on top of. Its major issues are:

-Test/complete/refactor for full DB-API 2.0 support
-Add bytea support
-Add extension support, perhaps modeled on what Psycopg.
-Build a COPY extension
-Confirm/add multi-threaded support
-Confirm/add support for the most common standard types (such as array)

Any other suggestions before I turn the above into a roadmap page on the
wiki?

--
Greg Smith 2ndQuadrant US Baltimore, MD
PostgreSQL Training, Services and Support
greg(at)2ndQuadrant(dot)com www.2ndQuadrant.us

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2010-02-06 23:55:30 Re: Confusion over Python drivers
Previous Message Robert Haas 2010-02-06 22:36:27 Re: BUG #5305: Postgres service stops when closing Windows session