Symptoms
There is an event handler that is not needed anymore, it is required to delete it. However attempt to delete it fails with an error message:
ERROR: update or delete on table "TaskHandler" violates foreign key constraint "Task_EHID" on table "Task"
Cause
There are failed tasks generated by this event.
Resolution
You may remove these failed tasks:
Home > System > Settings > Events > Event Type Name > Name Event Handler CONTAINER > Tasks
select all of them and click Delete button.
After that it shall become possible to delete the handler.