summaryrefslogtreecommitdiff
path: root/psycopg/pqpath.c
diff options
context:
space:
mode:
Diffstat (limited to 'psycopg/pqpath.c')
-rw-r--r--psycopg/pqpath.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/psycopg/pqpath.c b/psycopg/pqpath.c
index 54263bc..14eecd2 100644
--- a/psycopg/pqpath.c
+++ b/psycopg/pqpath.c
@@ -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;
}