]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
postgres wraps exec's in SQLError catch
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 26 Feb 2006 20:15:02 +0000 (20:15 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 26 Feb 2006 20:15:02 +0000 (20:15 +0000)
lib/sqlalchemy/databases/postgres.py

index 238310b1b1daa01ab910ecdf866e67f0e69fbba0..cd43bc3f0a0b9b282536d84de1958c0271eedde6 100644 (file)
@@ -248,7 +248,10 @@ class PGSQLEngine(ansisql.ANSISQLEngine):
         to produce this correctly for an executemany, so we do our own executemany here."""
         rowcount = 0
         for param in parameters:
-            c.execute(statement, param)
+            try:
+                c.execute(statement, param)
+            except Exception, e:
+                raise exceptions.SQLError(statement, param, e)
             rowcount += c.rowcount
         self.context.rowcount = rowcount