2008-03-07 Jason Erickson <jerickso@stickpeople.com>

* psycopg/pqpath.c (pq_raise): if PSYCOPG_EXTENSIONS is not
	defined, raise OperationalError rather than
	TransactionRollbackError for deadlock or serialisation errors for
	protocol versions less than 3.
This commit is contained in:
James Henstridge 2008-03-06 18:41:07 +00:00
parent 89cadcb553
commit 475df5ebd6
2 changed files with 8 additions and 0 deletions

View File

@ -1,5 +1,9 @@
2008-03-07 Jason Erickson <jerickso@stickpeople.com>
* psycopg/pqpath.c (pq_raise): if PSYCOPG_EXTENSIONS is not
defined, raise OperationalError rather than
TransactionRollbackError for deadlock or serialisation errors.
* psycopg/psycopgmodule.c (psyco_connect): fix off by one error in
calculating the length of the DSN.

View File

@ -196,7 +196,11 @@ pq_raise(connectionObject *conn, cursorObject *curs, PGresult *pgres)
exc = IntegrityError;
else if (strstr(err, "could not serialize") ||
strstr(err, "deadlock detected"))
#ifdef PSYCOPG_EXTENSIONS
exc = TransactionRollbackError;
#else
exc = OperationalError;
#endif
else
exc = ProgrammingError;
}