Re: Inheritance and reference integrity

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Inheritance and reference integrity
Дата
Msg-id Pine.LNX.4.30.0105191939250.758-100000@peter.localdomain
обсуждение исходный текст
Ответ на Inheritance and reference integrity  (Jani Averbach <jaa@cc.jyu.fi>)
Список pgsql-general
Jani Averbach writes:

> CREATE TABLE vehicle(
>         id      SERIAL,
>         color   TEXT,
>         CONSTRAINT PK_vehicle PRIMARY KEY (id)
> );
> CREATE TABLE car(
>         driver  TEXT
> )INHERITS(vehicle);
> CREATE TABLE foobar(
>         snafu   TEXT,
>         driver_id  INTEGER CONSTRAINT CR_foobar_driver_id REFERENCES car (id)
> );

> psql:inherits_test.sql:25: ERROR:  UNIQUE constraint matching given keys
> for referenced table "car" not found

The primary key is not inherited by "car" from "vehicle".  In general,
mixing foreign keys and inheritance is not recommendable in the current
state of the implementation.

--
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter


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

Предыдущее
От: Jani Averbach
Дата:
Сообщение: Inheritance and reference integrity
Следующее
От: Per-Olof Pettersson
Дата:
Сообщение: Create an empty record