PostgreSQL Interface Query

John Bell jbell at iinet.net.au
Sun Oct 14 09:19:19 EDT 2001


Stuart Bishop wrote:

> On Saturday, October 13, 2001, at 02:05  PM, John Bell wrote:
>
> > I have been evaluating various Python interfaces to PostgreSQL.  So far
> > as I've been able to determine the options are PygreSQL (packaged with
> > PostgreSQL), PoPy, psycopg and a new entrant, pypgsql.  I am leaning
> > towards pypgsql (available from SourceForge) based on an comparitive
> > assessment of functionality only.  However, as pypgsql is just under a
> > year old and I've never heard it mentioned on any major Python or
> > PostgreSQL forum before I am somewhat concerned regarding its
> > stability.  I would be very interrested in comments from anyone with
> > experience of the pypgsql package.
>
> I got as far as checking its threadsafety - level 1 compliance
> is a major lack to me. I also stick to using the DB API, so I can't
> see any improvement in functionality to PoPy or Psycopg. If you only
> want a thread level 1 compliant driver, is there any real advantage
> over using PyGreSQL which is shipped as part of PostgreSQL?

For the moment the low level of thread safety is not an issue in this
project.  I agree that under most circumstances it would be better to stick
strictly to the DB API.  However, there appears to be a situation that is
only covered by the pypgsql package.  The cursor object has an attribute
which stores the OID of the last inserted row thus allowing for the indirect
retrieval of SERIAL keys for insertion in foreign key fields.  This doesn't
seem to be achievable in either PoPy or psycopg.  Please correct me if I'm
wrong.

>
>
> These issues may be the reason there is a lack of commentary on pypgsql.
> The other reason is that it must be a secret, as it still hasn't made
> it onto the DB-SIG's modules list.

I know.  I came across it quite by accident.

John

>
>
> --
> Stuart Bishop <zen at shangri-la.dropbear.id.au>




More information about the Python-list mailing list