From: Mike C. F. <mcf...@ro...> - 2003-12-05 21:11:51
|
Gerhard Häring wrote: ... > If we wanted to distinguish between these two, we'd need to parse the > PostgreSQL error strings, though. > > I'm personally against implementing this, because this whole error > message business looks like a mess to me in older PostgreSQL versions. > > PostgreSQL 7.4 and later, however, now have a reasonable error message > API, with error codes [1] that we could easily map to the > corresponding DB-API exception classes. > > -- Gerhard > > [1] > http://www.postgresql.org/docs/current/interactive/errcodes-appendix.html Sorry for taking so long to reply on this... I'm fine with leaving it as-is for 7.3, now that 7.4 is released. I'm wondering, though, does this mean that we'll need to match pyPgSQL version to PostgreSQL version, or is detection of postgres back-end version available? I'm working around the problem in my code (marking the connection invalid-and-to-be-recreated on *any* error), which is not optimal (there are, as a result, effectively no recoverable errors), but works ATM). Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ |