Python Interface To PostgreSQL ??

Gerhard Häring gerhard.nospam at bigfoot.de
Wed Aug 15 11:00:31 EDT 2001


On Wed, 15 Aug 2001 10:03:39 GMT, Peter Moscatt <pmoscatt at bigpond.net.au> wrote:
>I am trying to install PostgreSQL (onto my LINUX system) and have python 
>interface to the databases I create with it.

The standard PostgreSQL interface currently has a few annoying bugs, so I'd
recommend to use an alternative like http://sourceforge.net/projects/pypgsql/

PyGreSQL, the one included in PostgreSQL, offers an old API and a newer, DB-API
compatible one. IMHO it's always preferrable to code to the Python DB-API, as
this lets you change database modules and/or databases much more easily later
(i. e. change the import and the .connect statement and you're done).

>I haven't been able to compile with the python interface (./configure 
>--with-python).

PyGreSQL's build process is distutils based, so you can change to
src/interfaces/python, change the paths in setup.py if necessary, then.

python setup.py build
python setup.py install                 # and even
python setup.py bdist_rpm               # if you like to :-)

Gerhard
-- 
mail:   gerhard <at> bigfoot <dot> de       registered Linux user #64239
web:    http://www.cs.fhm.edu/~ifw00065/    public key at homepage
public key fingerprint: DEC1 1D02 5743 1159 CD20  A4B6 7B22 6575 86AB 43C0
reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b')))



More information about the Python-list mailing list