Skip to content

Commit

Permalink
merge_oa add logging to second insert try
Browse files Browse the repository at this point in the history
  • Loading branch information
pnoll1 committed Mar 24, 2024
1 parent 0b30b4b commit c6a3c5d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion osmand_osm/osm/oa.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,12 @@ def merge_oa(self, db_name):
cur.execute(f'insert into {source.table} select * from {source.table_temp} on conflict do nothing')
logging.info(source.table + ' Insert ' + str(cur.rowcount))
except psycopg.errors.InvalidParameterValue as error:
logging.error(f'{source.table} errored on merge_oa insert: {error}')
logging.warning(f'{source.table} InvalidParameterValue during merge_oa insert: {error}')
conn.rollback()
# get rid of z geometry
cur.execute(f'alter table {source.table_temp} alter column wkb_geometry type geometry(point, 4326) using ST_Force2D(wkb_geometry);')
cur.execute(f'insert into {source.table} select * from {source.table_temp} on conflict do nothing')
logging.info(source.table + ' Insert ' + str(cur.rowcount))
# get rid of temp table
cur.execute(f'drop table {source.table_temp}')
conn.commit()
Expand Down

0 comments on commit c6a3c5d

Please sign in to comment.