Subject Re: [ib-support] gfix & system tables question
Author Martijn Tonies
Hi,

> When using gfix I have not found a way to have some system table check
> for data integrity : RDB$RELATION_CONSTRAINTS & RDB$REF_CONTRAINTS
> where I could find some 'orphaned' rows
>
> I understand the following
> when creating as FK from tableA to tableB
> there should an entry in
>
> RDB$RELATION_CONSTRAINTS describing the name of the constraint, the
> relation it applies to (TABLEA) and the name of the index to be used
> (in the example of an FK)
>
> RDB$REF_CONTRAINTS describing what PK is to be used and what action to
> be taken (eg RESTRICT) when deleting or updating. (then it's simply a
> matter of rereading RDB$RELATION_CONSTRAINTS to find out which table
> it applies to.
>
> I have found cases where there was 1 record in
> RDB$RELATION_CONSTRAINTS and none on RDB$REF_CONTRAINTS and 1 example
> of the contrary. FB does not choke on this and obviously this should
> not happen in a live dn scenario, but can apparently happen with
> developement databases.

Actually - this should simply NEVER happen.

And you are sure it's a FK constraint in RDB$RELATION_CONSTRAINTS?



With regards,

Martijn Tonies
InterBase Workbench - the developer tool for InterBase & Firebird
Firebird Workbench - the developer tool for Firebird
Upscene Productions
http://www.upscene.com

"This is an object-oriented system.
If we change anything, the users object."