Hello,
Matthew Woodcraft and me have worked on exposing PQresultErrorField on
the Error object, allowing to get detailed information from a server
error. This includes the new diagnostics fields to be released in
PostgreSQL 9.3.
Ticket: http://psycopg.lighthouseapp.com/projects/62710-psycopg/tickets/149
Docs:
http://initd.org/psycopg/docs/module.html#psycopg2.Error.diaghttp://initd.org/psycopg/docs/extensions.html#psycopg2.extensions.Diagnostics
The feature needs the PQresult stored into Error, making it a
StandardError subclass with a customized C structure. Unfortunately
this breaks Python 2.4, where the exceptions were old style classes.
Working around the issue seems a messy matter of #ifdefs scattered all
around the code: I think it would be better to just pull the plug on
Python 2.4 for psycopg release 2.5. If there was a 2.4.7 release (it
could be: there is a couple of bug fixed and, sigh, another Zope
problem) it would still be compatible with Python 2.4.
Issues? Objections? Let me know.
Cheers,
-- Daniele