Skip to content

Commit

Permalink
add generic exception when fallback on inserts to trap unexpected dat…
Browse files Browse the repository at this point in the history
…a not handled by psycopg2
the4thdoctor committed Jul 6, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 54f4c5c commit d418fcb
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@ changelog
* add geometry to the supported types
* add varbinary and geometry to hexify in config-example.yaml
* add INDEX to excluded words when parsing alter table. this prevents the ddl replica to crash when the alter table adds an index
* Fix for `Issue #4 <https://github.com/the4thdoctor/pg_chameleon/issues/4>`_ add generic exception when fallback on inserts to trap unexpected data not handled by psycopg2

1.3.1 - 19 Jun 2017
...........................................
5 changes: 5 additions & 0 deletions pg_chameleon/lib/pg_lib.py
Original file line number Diff line number Diff line change
@@ -440,6 +440,11 @@ def insert_data(self, table, insert_data, my_tables={}):
except psycopg2.Error as e:
self.logger.error("SQLCODE: %s SQLERROR: %s" % (e.pgcode, e.pgerror))
self.logger.error(self.pg_conn.pgsql_cur.mogrify(sql_head,column_values))
except:
self.logger.error("unexpected error when processing the row")
self.logger.error(" - > Table: %s" % table)
self.logger.error(" - > Insert list: %s" % (','.join(column_copy)) )
self.logger.error(" - > Insert values: %s" % (column_values) )

def build_idx_ddl(self):
"""

0 comments on commit d418fcb

Please sign in to comment.