diff options
-rw-r--r-- | lib/sqlalchemy/databases/postgres.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/sqlalchemy/databases/postgres.py b/lib/sqlalchemy/databases/postgres.py index 238310b1b..cd43bc3f0 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 |