The userId is also a foreign key in records in other tables that are created by other users. To flag records as deleted instead of actual deleting records is a common way of solving this problem. There might be situations where it would work to delete the actual record, but instead of having a solution to say "sometimes we delete it sometimes we just flag it" my personal opinion is to do it consistent in all tables the same way. Otherwise: If there is a majority of developers that would like to change it and will do the neccessary work => go for it :)
Sebastian 2012/4/14 Hamdi THABET <[email protected]> > I'm using Postgresql DB. > I read the *Wikipedia* article about referential integrity but I still > can't understand why we are obliged to keep deleted users in the "users" > table. > Even in the case of referential integrity we can delete all entries > related to the deleted "userId" in all tables. Not ? > > There's a lot of disadvantages when keeping absolute entries in a such > important table in DB. > This is a preliminary administration task and I think that all meetings > and activities created by a deleted user must be deleted too. > -- Sebastian Wagner https://twitter.com/#!/dead_lock http://www.openmeetings.de http://www.webbase-design.de http://www.wagner-sebastian.com [email protected]
<<608-1041a.jpg>>
