Skip to content
Snippets Groups Projects
Commit 47268ec8 authored by Kirill Stytsenko's avatar Kirill Stytsenko
Browse files

Remove URI from ON CONFLICT constraint

the target table does not have this column so it can't be part of the conflict


Former-commit-id: 586b9d91
parent 55ef993d
Branches
Tags
No related merge requests found
...@@ -36,10 +36,10 @@ def insert_mdb_columns_concepts(cdbid,tid, cid, uri): ...@@ -36,10 +36,10 @@ def insert_mdb_columns_concepts(cdbid,tid, cid, uri):
cursor = conn.cursor() cursor = conn.cursor()
# Insert tblnames into table mdb_TABLES # Insert tblnames into table mdb_TABLES
cursor.execute("INSERT INTO mdb_columns_concepts (cDBID,tID, cID,URI,created) VALUES (%s,%s,%s,%s,current_timestamp) ON CONFLICT (cDBID, tID, cID, URI) DO NOTHING", (cdbid,tid,cid,uri)) cursor.execute("INSERT INTO mdb_columns_concepts (cDBID,tID, cID,URI,created) VALUES (%s,%s,%s,%s,current_timestamp) ON CONFLICT (cDBID, tID, cID) DO UPDATE SET uri = EXCLUDED.uri", (cdbid,tid,cid,uri))
r = cursor.rowcount r = cursor.rowcount
conn.commit() conn.commit()
conn.close() conn.close()
except Exception as e: except Exception as e:
print("Error while connecting to metadatabase.",e) print("Error while connecting to metadatabase.",e)
return r return r
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment