Re: Inheritance on foreign key

Поиск
Список
Период
Сортировка
От Erik Jones
Тема Re: Inheritance on foreign key
Дата
Msg-id 0CC9C7C6-F44D-4530-B185-C8516027F451@engineyard.com
обсуждение исходный текст
Ответ на Inheritance on foreign key  (Takeichi Kanzaki Cabrera <tkanzakic@gmail.com>)
Ответы Re: Inheritance on foreign key  (decibel <decibel@decibel.org>)
Re: Inheritance on foreign key  (decibel <decibel@decibel.org>)
Список pgsql-general
On Oct 9, 2009, at 9:57 AM, Takeichi Kanzaki Cabrera wrote:

> Hi everybody, I need your help. I have a hierarchy of tables, and
> other table that has a foreign key with the top table of the
> hierarchy, can I insert a value into the "other" table where the value
> it reference is not on the parent table? (it's in one of its child)

No, foreign key checks do not (yet) follow inheritance hierarchies.
Here's the specific clause in the manual (http://www.postgresql.org/docs/8.4/interactive/ddl-inherit.html
) that covers this:

"All check constraints and not-null constraints on a parent table are
automatically inherited by its children. Other types of constraints
(unique, primary key, and foreign key constraints) are not inherited."

Erik Jones, Database Administrator
Engine Yard
Support, Scalability, Reliability
866.518.9273 x 260
Location: US/Pacific
IRC: mage2k






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

Предыдущее
От: "Joshua D. Drake"
Дата:
Сообщение: PostgreSQL Conference West, registration closing
Следующее
От: Dave Huber
Дата:
Сообщение: creating a function with another function