Forum OpenACS Q&A: Re: can't delete an acs_object -> ERROR: update or delete on "acs_objects" violates foreign key constraint "acs_objects_context_id_fk" on "acs_objects"

for the poor and unfortunate souls that might get screwed by this... it appears before calling content::folder::delete one must first do this magic incantation:

db_list bla {select acs_message__delete(object_id) from acs_objects where object_id in
(select comment_id from general_comments where object_id in
(select b.item_id from cr_items a, cr_items b
where b.tree_sortkey between a.tree_sortkey and tree_right(a.tree_sortkey)
and a.item_id = :item_id))}