which postgresql DB-API for python?
Gerhard Häring
gerhard.haering at gmx.de
Fri Jan 3 12:12:02 EST 2003
Oliver Vecernik wrote:
> Hi!
>
> I'd like to write a small database app and found a lot of DB-API's:
>
> * pygresql
> * popy
> * pgsql
> * psycopg
> * pypgsql
>
> Which on should I use?
pyPgSQL (or psycopg), but I'm biased (see .signature) ;-)
> Are there any main advantages for one of them?
pyPgSQL has some interesting features, like the ability to set a
transaction isolation level, an implementation of the NUMERIC type on
the client side, Unicode support, and other goodies.
It also wraps the low-level PostgreSQL API in a module called libpq.
But if you want to use the DB-API module, this is just an
implementation detail ;-)
psycopg is optimized for heavily multithreaded applications.
I don't know what you mean with 'pgsql'.
> Why are there such a lot of implementations. Does none of them fit all
> requirements?
This really depends on the exact requirements.
> I'd like to use my app on Linux (Debian/Woody)
Woody's (and testing's :-( ) pyPgSQL is still at version 2.0. If you
need newer features, like Unicode it seems like you'll currently need
to upgrade to version 2.3 manually.
> and on Windows (W2K/XP) together with wxWindows.
pyPgSQL is the only one to offer a win32 port readily available. But
I've seen a win32 version of psycopg mentioned on its mailing list.
Gerhard
--
Favourite database: http://www.postgresql.org/
Favourite programming language: http://www.python.org/
Combine the two: http://pypgsql.sf.net/
Embedded database for Python: http://pysqlite.sf.net/
More information about the Python-list
mailing list