Re: Inheritance and reference integrity

Поиск
Список
Период
Сортировка
Искать
От
Peter Eisentraut
Тема
Re: Inheritance and reference integrity
Дата
в 13:40:48
Msg-id
Pine.LNX.4.30.0105191939250.758-100000@peter.localdomain
Ответ на
Список
Дерево обсуждения
Inheritance and reference integrity Jani Averbach <jaa@cc.jyu.fi>
Re: Inheritance and reference integrity Peter Eisentraut <peter_e@gmx.net>
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
Дата:
От: Per-Olof Pettersson
Дата:
Сообщение: Create an empty record
FAQ