RAISENOTICE'before_claim_insertupdatedelete3 took %',part_end-part_start;
SELECT*fromclock_timestamp()intoproc_end;
RAISENOTICE'before_claim_insertupdatedelete took %',proc_end-proc_start;
IFTG_OP='DELETE'THEN
RETURNOLD;
ENDIF;
...
...
@@ -839,14 +779,7 @@ DECLARE
task_aborted_status_idint:=1100;--beware: hard coded instead of lookup for performance
affected_claimresource_allocation.resource_claim;
claim_has_conflictsboolean;
proc_starttimestampwithtimezone;
proc_endtimestampwithtimezone;
part_starttimestampwithtimezone;
part_endtimestampwithtimezone;
BEGIN
SELECT*fromclock_timestamp()intoproc_start;
SELECT*fromclock_timestamp()intopart_start;
-- in the before trigger function, everything on the claim has been checked and adapted.
-- now (in the after trigger, when all claims were inserted/updated in the database), let's check if the task should also be updated (to conflict status for example)
-- only if claim status was changed or inserted...
...
...
@@ -855,38 +788,19 @@ BEGIN
--if claim status went to conflict, then set the task status to conflict as well