From: SourceForge.net <no...@so...> - 2005-02-20 05:03:32
|
Patches item #987719, was opened at 2004-07-08 23:55 Message generated for change (Comment added) made by ballie01 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=316528&aid=987719&group_id=16528 Category: None Group: None Status: Open >Resolution: Postponed Priority: 5 Submitted By: Ken Lalonde (kenlalonde) Assigned to: Nobody/Anonymous (nobody) Summary: Access to SQLSTATE + memory leak Initial Comment: It would be nice if one had access to the postgresql 5 character "SQLSTATE" error code, to, for example, unambiguously determine if a serialization error happened and the transaction should be re-run. The error code is more precise and future-proof than a substring check on the textual error message. I've attached a patch to the 2.4 version of pgconnection.c. It changes the value of a libpq.OperationalError exception to a tuple: (sqlstate, message), a la OSError. This fix is sufficient, but I lack the pythonic karma to say if it's the best way. I added a missing PQclear() call too. ---------------------------------------------------------------------- >Comment By: Billy G. Allie (ballie01) Date: 2005-02-20 00:03 Message: Logged In: YES user_id=8500 This requires libpq protocol 3 in order to work. I will investigate what is needed to maintain compatibility with protovol version 2 of libpq. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=316528&aid=987719&group_id=16528 |