From: Mike Bayer Date: Sun, 26 Feb 2006 20:15:02 +0000 (+0000) Subject: postgres wraps exec's in SQLError catch X-Git-Tag: rel_0_1_3~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c5fd3d13507479470fba2effc85094163e81dd6a;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git postgres wraps exec's in SQLError catch --- diff --git a/lib/sqlalchemy/databases/postgres.py b/lib/sqlalchemy/databases/postgres.py index 238310b1b1..cd43bc3f0a 100644 --- a/lib/sqlalchemy/databases/postgres.py +++ b/lib/sqlalchemy/databases/postgres.py @@ -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