Forum OpenACS Development: Re: Problem when i tried to delete a user from db (nuke user)

Collapse
Posted by russ m on
Enrique - I realise that just saying we should use "on delete cascade" doesn't solve your immediate problem... crawling through the various pg_ tables to essentially do the cascade yourself is the way to do what you're trying to do right now.

But I think the general solution is to add "on delete cascade" to most FK constraints in OpenACS... as it stands, if you do want to delete from the DB an object that may have had any of OACS's "object generic" services used on it (comments, relations, whatever) you need to manually find everything that's got an FK reference to the object in question and delete them first. In my opinion that's work that the database should be doing (hell, it's *why* "on delete cascade" exists in the SQL spec)...