Sometimes I have problems using my BD At Work. Usually is when i try to recover or update a table in Java with the session closed (the famous LazyInitializatioException ). And at the end, sometimes the problem is that exists a foreign key pointing to a value of a non existing primary key index. When it happens, the lazy entity doesn't load correctly.
So, is there a way to check if a table data has foreign keys indexes set to non existing primary keys ?
For a single column would be easy. But I mean for tables with about 10 or 20 foreign keys.
Im using postgres. If thats an answer especificaly for it it'd be much better. =]
Sorry for my bad English (not native).