Subject Re: Corrupt database
Author Alexander V.Nevsky
--- In firebird-support@yahoogroups.com, "zifnabbe" <zifnabbe@u...> wrote:
> Mmm,
>
> When I restore with -inactive. then I can activate all indexes except
> on foreign:
>
> Cannot commit transaction:
> violation of FOREIGN KEY constraint "".
> violation of FOREIGN KEY constraint "PK_PERSONS" on table "PERSONS".
>
> How do I've to interprete this?
>
> Where can the problem be? at the persons table or the other one?

In both. "Master" could lose record when page-level repair was made
or in "detail" was inserted record which have'nt parent in master
because of broken index on one of the tables in source database.
Search such a records by

Select Detail.* From Detail
Where Not Exist(Select Master.ID From Master Where
Master.ID=Detail.FK_Column)

looking on this records you can take decision what should be done -
try to insert lost record into master or delete them from detail.

Best regards,
Alexander.