aboutsummaryrefslogtreecommitdiffstats
path: root/python/position.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/position.py')
-rw-r--r--python/position.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/python/position.py b/python/position.py
index 9af6d5c9..555f7a17 100644
--- a/python/position.py
+++ b/python/position.py
@@ -92,8 +92,9 @@ def update_fx(engine, session, currencies):
colnames.append(currency_pair)
values.append(v['FIXED_CLOSING_PRICE_NY'])
values = [v['PX_CLOSE_DT']] + values
- sqlstr = 'INSERT INTO fx({0}) VALUES({1})'.format(",".join(colnames),
- ",".join(["%s"]*len(values)))
+ sqlstr = 'INSERT INTO fx({0}) VALUES({1}) ON CONFLICT DO NOTHING'.format(
+ ",".join(colnames),
+ ",".join(["%s"]*len(values)))
conn = engine.raw_connection()
with conn.cursor() as c:
c.execute(sqlstr, values)