| От | Tom Lane |
|---|---|
| Тема | Re: finding data violating constraint |
| Дата | |
| Msg-id | 15853.1098197861@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | finding data violating constraint ("Keith Worthington" <keithw@narrowpathinc.com>) |
| Список | pgsql-novice |
"Keith Worthington" <keithw@narrowpathinc.com> writes:
> I am trying to build a foreign key constraint. The objective is to prevent
> parts from being entered that do not have a valid sales account. When I try
> to build the constraint it fails telling me that there is a violation. I have
> looked at the data and just can't seem to find the problem. Is there a way to
> find the data that is causing the problem?
Use a more recent version of Postgres?
In 7.4 I get something like
regression=# alter table bar add foreign key (f1) references foo;
ERROR: insert or update on table "bar" violates foreign key constraint "$1"
DETAIL: Key (f1)=(2) is not present in table "foo".
regards, tom lane
В списке pgsql-novice по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера