I have two table
1.user 2.posts
user
user_id name
1 A
2 B
posts
post_id post user_id
1 Post A 1
2 Post B 2
2 Post C 2
here relation user.user_id to post.user_id.Here i set ON DELETE restrict on posts.user_id.If i try to delete user then i got an error "Cannot delete or update a parent row: a foreign key constraint fails....".This error i could handle in development mode using try catch.But if i try to move production mode then i cannot handle this error. Now I want if user try to delete user from user table then a simple message show to user "You can not delete" in production mode;