Inheritance, foreign key constraint

Поиск
Список
Период
Сортировка
От Verena Ruff
Тема Inheritance, foreign key constraint
Дата
Msg-id 20050612213630.M14028@webmail.netmonic.com
обсуждение исходный текст
Список pgsql-novice
Hi,

I have a question relation inherited tables and foreign key constraints:

Following situation:
Table Person, PK pers_id
Table Customer, PK kun_id, inherited from Person
Table Contact, FK pers_id from Person

I insert a record into Customer. "SELECT * FROM Person" gives now a part of
this new record. Now I try to insert a record into Contact, using pers_id from
the newly inserted record of Customer. pgsql rejects because of violence of
the foreign key constraint.

I understood inheritance that every record of Customer is a Person, too. But
this looks like I only could take a "pure" record of Person to fullfill this
constraint. Is this right?

Thanks in advance,
Verena

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

Предыдущее
От: Bruno Wolff III
Дата:
Сообщение: Re: accessing data from other databases?
Следующее
От: Volkan YAZICI
Дата:
Сообщение: Steps taken through while transmitting binary data