- SELECT * INTO item FROM requirement_spec_items WHERE id = item_id;
- RAISE DEBUG 'updateRSIE: item_id % parent_id %', item_id, item.parent_id;
-
- IF item.parent_id IS NULL THEN
- -- Don't do anything for sections.
- RAISE DEBUG 'updateRSIE: this is a section.';
+ IF EXISTS(
+ SELECT *
+ FROM trigger_information
+ WHERE (key = 'deleting_requirement_spec_item')
+ AND (value = CAST(item_id AS TEXT))
+ LIMIT 1
+ ) THEN
+ RAISE DEBUG 'updateRSIE: item_id % is about to be deleted; do not update', item_id;