I need to connect to an old PostGreSQL database (version 7.3), and I am using Python 3.2 on an XP machine. The py-postgresql package seemed appropriate, but it seems that it only uses the 3.0 protocol, which was implemented in version 7.4. I’d like to connect to this database using Python, but when I’ve tried I have received an unexpected EOF error, which I believe is the result of the package using the newer protocol.
I can use the pgAdminIII program to connect to the database just fine. Any ideas?
Unfortunately for you, both py-postgresql and psycopg2 only support the v3 protocol.
I think your only option is to use the Postgres ODBC driver, and connect to it using pyODBC or mxODBC. There is a Python 3.x port of pyodbc linked from their main project page.