A question about constraints.

Поиск
Список
Период
Сортировка
От Stephen Ingram
Тема A question about constraints.
Дата
Msg-id 20011214173457.RFNF19288.femail15.sdc1.sfba.home.com@there
обсуждение исходный текст
Ответы Re: A question about constraints.  (Francisco Reyes <lists@natserv.com>)
Список pgsql-novice
Hullo,

I have added a constraint to a table to prevent it loading
data unless its key field is in another table (whose data
I have previously loaded)


ALTER TABLE OnMap ADD CONSTRAINT objid_check1   FOREIGN KEY (fname, lname)
                                                REFERENCES Object (fname, lname);


Indeed, the constraint works:

COPY OnMap FROM '/data/OnMap.dump' USING DELIMITERS '|'

psql:OnMap:1: ERROR:  objid_check1 referential integrity violation - key referenced
 from onmap not found in object

But... is there anyway to get PostgreSQL to tell me which record or records
are failing to load ?

I am assuming I am doing something stupid here.

Cheers

Steve


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

Предыдущее
От: "Josh Berkus"
Дата:
Сообщение: Re: Custom Reports
Следующее
От: Leandro Fanzone
Дата:
Сообщение: Re: Multiple IN