Open aviNrich opened 1 year ago
I can't reproduce this issue. Can you provide more details?
CREATE UNIQUE PROPERTY INDEX entities_u ON entities(text, label);
MERGE (n:entities { text : 'ABC', label : 'DEF' })
SET n.type = 'ABC', n.text = 'ABC', n.label = 'DEF'
RETURN n;
n
-------------------------------------------------------------
entities[3.1]{"text": "ABC", "type": "ABC", "label": "DEF"}
(1 row)
MERGE (n:entities { text : 'ABC', label : 'DEF' })
SET n.type = 'ABC', n.text = 'ABC', n.label = 'DEF'
RETURN n;
n
-------------------------------------------------------------
entities[3.1]{"text": "ABC", "type": "ABC", "label": "DEF"}
(1 row)
DROP GRAPH cypher_dml2 CASCADE;
@emotionbug thanks for the quick reply. Its a concurrent issue, I have a lot of traffic to this node, once in 10,000 calls it throws this error....
I have set my
CREATE UNIQUE PROPERTY INDEX IF NOT EXISTS entities_u ON entities(text, label)
I'm running the query inside a transaction:error: duplicate key value violates unique constraint "entities_u" Merge is some sort of an UPSERT, dont you think that "duplicate key value violates unique constraint" is not suitable here? Thanks