Re: referential integrity violations

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: referential integrity violations
Дата
Msg-id 20030610155633.X68889-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на referential integrity violations  ("Shaun W. Kruger" <shaun@linuxhost.cc>)
Список pgsql-general
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



В списке pgsql-general по дате отправления:

Предыдущее
От: Dmitry Tkach
Дата:
Сообщение: Re: referential integrity violations
Следующее
От: Tom Lane
Дата:
Сообщение: Re: error restoring large objects during pg_restore