Forum OpenACS Q&A: unable to delete a package
ERROR: pa_pack_fldr_map_pack_id_fk referential integrity violation - key in apm_packages still referenced from pa_package_root_folder_map
The above is the error I am getting when I am trying to delete the Presentations (wimpy point) package. What am I doing wrong ?
and starting all over again with the latest tarball has solved the problem at least for deleting presentations.
The truth is...
The problem you ran into is pervasive. And, unfortunately, your solution is all too often the only solution to this problem. Well, that's not entirely true. You could resort to plsql to remove references and dependencies, but it's tedious, frustrating, error-prone, and just plain difficult.
In *most* cases, once you add content (actually, acs_objects and permissions), you're stuck with it until you drop/create the DB. There are several discussion threads in the forums that debate the rightness/wrongness of this "feature". The thing is, if you write your own packages, set up the model appropriately with cascaded deletes and triggers to remove explicit permissions and acs_objects.
As for the existing packages and core, maybe someday this "feature" will be fixed.
You can probably reproduce the error you saw by adding wimpy point content and trying to delete the wimpy point package again.
There might be lots of other dependencies though, and there are reasons for not adding on delete cascade on those, see previous discussions. But for a basic object with some perms attached it should work. Not sure if it's already in 4.6.3 though.