psycopg and popy in python2.0?
Harry George
hgg9140 at cola.ca.boeing.com
Mon Apr 2 11:06:18 EDT 2001
PoPy core dumps and Psycopg works. Notes on google/deja seem to
indicate this is a valid setup. Anyone see something obvius?
On Redhat 6.2,
1. postgres 7.0.3: pg_ctl status gives:
pg_ctl: postmaster is running (pid: 5316)
options are:
/usr/local/pgsql/bin/postmaster
-p 5432
-D /usr/local/pgsql/data
-B 64
-b /usr/local/pgsql/bin/postgres
-N 32
2. popy 2.0.2 (with its embedded mxDateTime). Copied pg_type.h to
/usr/include/catalog, per instructions.
./configure --prefix=/usr/local \
--with-python=/usr/local/bin/python2.0 \
--with-python-version=2.0 \
--with-postgres-libraries=/usr/local/pgsql/lib \
--with-postgres-includes=/usr/local/pgsql/include
gmake
python2.0
>>> import os,sys
>>> import PoPy as dbi
>>> db=dbi.connect('dbname=testdb user=postgres')
>>> c=db.cursor()
>>> c.execute("select * from pg_class")
>>> results=c.fetchall()
(core dump)
Message from pg_ctl:
ERROR: Relation 71 does not exist
pq_recvbuf: unexpected EOF on client connection
ERROR: Relation 71 does not exist
pq_recvbuf: unexpected EOF on client connection
3. psycopg 0.5. Had to install mx-base 2.0.0, then symlink the
mxDateTime module to the site-packages level (psycopg couldn't find it
in the site-packages/mx tree).
./configure --prefix=/usr/local \
--with-python=/usr/local/bin/python2.0 \
--with-python-version=2.0 \
--with-postgres-libraries=/usr/local/pgsql/lib \
--with-postgres-includes=/usr/local/pgsql/include \
--with-mxdatetime-includes=\
/usr/local/src/toolkit/mx/egenix-mx-base-2.0.0/mx/DateTime/mxDateTime
gmake
python2.0
>>> import os,sys
>>> import psycopg as dbi
>>> db=dbi.connect('dbname=testdb user=postgres')
>>> c=db.cursor()
>>> c.execute("select * from pg_class")
>>> results=c.fetchall()
>>> print results
(results are ok)
--
Harry George E-mail: harry.g.george at boeing.com
The Boeing Company Renton: (425) 237-6915
P. O. Box 3707 02-CA Everett: (425) 266-3868
Seattle, WA 98124-2207 Page: (425) 631-8803
More information about the Python-list
mailing list