Skip to content

Commit 0f1bb81

Browse files
committed
Updating ON CONFLICT statements
ON CONFLICT was trying to run only on specific columns. I've cleaned that out so it runs on any set of conflicts.
1 parent 9201449 commit 0f1bb81

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

function/ts/insertdatasetpi.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ CREATE OR REPLACE FUNCTION ts.insertdatasetpi(_datasetid integer, _contactid int
44
AS $function$
55
INSERT INTO ndb.datasetpis(datasetid, contactid, piorder)
66
VALUES (_datasetid, _contactid, _piorder)
7-
ON CONFLICT (datasetid, contactid) DO NOTHING;
7+
ON CONFLICT DO NOTHING;
88
$function$

function/ts/insertsteward.sql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,3 @@ AS $function$
1414
values ((select stewardid from ti.stewards AS stw where (stw.contactid = _contactid)), _databaseid)
1515
RETURNING stewardid
1616
$function$
17-

function/ts/updatechroncontrolevent.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ AS $function$
55
INSERT INTO ndb.eventchronology
66
(analysisunitid, eventid, chroncontrolid)
77
VALUES (_analysisunitid, _eventid, _chroncontrolid)
8-
ON CONFLICT ON CONSTRAINT uniqueeventset
8+
ON CONFLICT (analysisunitid, eventid, chroncontrolid)
99
DO UPDATE
1010
SET analysisunitid = _analysisunitid, eventid = _eventid, chroncontrolid = _chroncontrolid, notes = null
1111
WHERE ndb.eventchronology.eventchronologyid = (SELECT ec.eventchronologyid FROM ndb.eventchronology AS ec WHERE (chroncontrolid = _chroncontrolid))

0 commit comments

Comments
 (0)