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