On Tue, 10 Jun 2003, Shaun W. Kruger wrote:
> I'm getting some pretty strange results when doing a mass
> create of my database structure. I get the following when
> it goes to create the foreign keys. I just can't figure out
> why it is that half of them complain and the other half don't.
>
> NOTICE: ALTER TABLE will create implicit trigger(s) for
> FOREIGN KEY check(s)
> ALTER TABLE
> NOTICE: ALTER TABLE will create implicit trigger(s) for
> FOREIGN KEY check(s)
> ERROR: groupidfk referential integrity violation - key
> referenced from users not found in groups
> NOTICE: ALTER TABLE will create implicit trigger(s) for
> FOREIGN KEY check(s)
> ALTER TABLE
> NOTICE: ALTER TABLE will create implicit trigger(s) for
> FOREIGN KEY check(s)
> ERROR: justispidfk referential integrity violation - key
> referenced from userinfo not found in ispusers
> NOTICE: ALTER TABLE will create implicit trigger(s) for
> FOREIGN KEY check(s)
> ALTER TABLE
> NOTICE: ALTER TABLE will create implicit trigger(s) for
> FOREIGN KEY check(s)
> ERROR: uinfoidfk referential integrity violation - key
> referenced from payments not found in userinfo
The problem appears to be that you have invalid data in the tables and so
the constraints start off invalidated.
From 7.4:
NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY
check(s)
ERROR: groupidfk referential integrity violation - key (groupid)=(0)
referenced from users not found in groups
NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY
check(s)
ALTER TABLE
NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY
check(s)
ERROR: justispidfk referential integrity violation - key (justispid)=(0)
referenced from userinfo not found in ispusers
NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY
check(s)
ALTER TABLE
NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY
check(s)
ERROR: uinfoidfk referential integrity violation - key (uinfoid)=(0)
referenced from payments not found in userinfo