Re: inheritance and FK
От | Stephan Szabo |
---|---|
Тема | Re: inheritance and FK |
Дата | |
Msg-id | 20030303122023.J40687-100000@megazone23.bigpanda.com обсуждение исходный текст |
Ответ на | inheritance and FK (Oleg Lebedev <oleg.lebedev@waterford.org>) |
Список | pgsql-general |
On Mon, 3 Mar 2003, Oleg Lebedev wrote: > I am trying to create two tables: parent and child. Child inherits from > the parent and has a foregn key (FK) referencing parent's primary key > (PK). Suppose parent table has one row with PK = 1 and I have one row in > the child table with FK=1 and PK=2. Now, I want to insert another row in > the child table with FK = 2, however it won't let me do this, since > parent table does not have a record with PK = 2. > I was expecting that children tables will also be searched when > verifying a foreign key constraint referencing the parent table. > Is there a way to force this kind of "hierarchical" foreign key > constraint check? Not currently. Currently the check is applied only to the named table. In general, inheritance needs alot of work, and we need a comprehensive plan for all the problems (for example, primary keys also don't inherit).
В списке pgsql-general по дате отправления: