Skip to content
Snippets Groups Projects
Verified Commit 586b9d91 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
parent b5966866
No related branches found
No related tags found
4 merge requests!81New stable release,!43Merge dev to master,!40Misc,!39Column units
......@@ -36,10 +36,10 @@ def insert_mdb_columns_concepts(cdbid,tid, cid, uri):
cursor = conn.cursor()
# 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
conn.commit()
conn.close()
except Exception as e:
print("Error while connecting to metadatabase.",e)
return r
\ No newline at end of file
return r
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment