From: xtian <xt...@to...> - 2003-06-05 03:45:08
|
Hi - It looks like the PostGreSQL support for SQLObject expects psycopg - is there any particular reason for this? I'm doing development on Windows (although we'll eventually be deploying on Linux), and I don't think I can go through the compilation process required for psycopg. (Unless anyone has some compiled binaries for windows/Python2.2 lying around?) It doesn't look like it would take much to make PostgresConnection use PyPgSQL.PgSQL (which has binaries for windows), although I haven't looked closely. Are there any nasty gotchas I should know about? Have braver men tried and failed? Thanks, Christian |
From: Ian B. <ia...@co...> - 2003-06-05 03:55:12
|
On Wed, 2003-06-04 at 22:42, xtian wrote: > It looks like the PostGreSQL support for SQLObject expects psycopg - is > there any particular reason for this? I'm doing development on Windows > (although we'll eventually be deploying on Linux), and I don't think I > can go through the compilation process required for psycopg. (Unless > anyone has some compiled binaries for windows/Python2.2 lying around?) > > It doesn't look like it would take much to make PostgresConnection use > PyPgSQL.PgSQL (which has binaries for windows), although I haven't > looked closely. Are there any nasty gotchas I should know about? Have > braver men tried and failed? I chose psycopg because it was there -- I'm not up enough on Postgres to know what drivers are best, though psycopg seems to be one of the more actively maintained. I think it should be easy enough to use a different driver. I don't know if cursor.lastoid() is standard across the various Postgres drivers, otherwise I don't believe there's anything else that's not simple DBAPI. Try doing import pypgsql as psycopg at the top of DBConnection, and maybe run the test: python tests/test.py -dpostgres (For the testing environment you'll have to set up a database "test", like "createdb test") |
From: Edmund L. <el...@in...> - 2003-06-05 04:15:51
|
Ian Bicking wrote: > I chose psycopg because it was there -- I'm not up enough on Postgres to > know what drivers are best, though psycopg seems to be one of the more > actively maintained. I've used it. It is pretty good and is actively maintained. In my benchmarks, psycopg was faster. But, pyPgSQL uses a Python style license whereas psycopg uses the GPL. May or may not be important. pyPgSQL does wrap results in a class that allows access to columns via attribute style access, but it's not real important if you're layering SQLObject on top of it. Support for Python datatypes seems better than in psycopg To get last OID, use cursor.oidValue. It isn't standard across PostgreSQL drivers. Oh, one other thing--cursor.rowcount doesn't return anything unless a fetch is performed first, unlike psycopg. ...Edmund. |
From: Luke O. <lu...@me...> - 2003-06-05 04:28:40
|
There is an old version of psycopg compiled for windows at http://www.stickpeople.com/projects/python/psycopg/ we use it here for similar purposes (build on windows, deploy on linux) with complete success. (Just unpack the zip file and copy psycopg.pyd and libpq.dll to your site-packages directory.) I know we had trouble using pyPgSQL instead in the past with SQLObject, largely I think because pyPgSQL does some odd stuff with creating it's own PgTypes for a lot of return values (as I recall, might have been something else...) psycopg is much much faster for us, as a bonus. - Luke Quoting xtian <xt...@to...>: > Hi - > > It looks like the PostGreSQL support for SQLObject expects psycopg - is > there any particular reason for this? I'm doing development on Windows > (although we'll eventually be deploying on Linux), and I don't think I > can go through the compilation process required for psycopg. (Unless > anyone has some compiled binaries for windows/Python2.2 lying around?) > > It doesn't look like it would take much to make PostgresConnection use > PyPgSQL.PgSQL (which has binaries for windows), although I haven't > looked closely. Are there any nasty gotchas I should know about? Have > braver men tried and failed? > > Thanks, > Christian > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Etnus, makers of TotalView, The best > thread debugger on the planet. Designed with thread debugging features > you've never dreamed of, try TotalView 6 free at www.etnus.com. > _______________________________________________ > sqlobject-discuss mailing list > sql...@li... > https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss > -- i find your contempt for naked feet curious. |
From: xtian <xt...@to...> - 2003-06-05 04:43:16
|
Thanks Ian, Luke and Edmund - Yes, I was looking through the pyPgSQL docs, and the notes about things differing from the DB-api worried me a bit. I've got the old version of psycopg you've mentioned, and it seems to work fine. Cheers, Christian Luke Opperman wrote: > There is an old version of psycopg compiled for windows at > http://www.stickpeople.com/projects/python/psycopg/ we use it here for > similar purposes (build on windows, deploy on linux) with complete success. > (Just unpack the zip file and copy psycopg.pyd and libpq.dll to your > site-packages directory.) > > I know we had trouble using pyPgSQL instead in the past with SQLObject, largely > I think because pyPgSQL does some odd stuff with creating it's own PgTypes for > a lot of return values (as I recall, might have been something else...) > > psycopg is much much faster for us, as a bonus. > > - Luke > |