I have a simple inheritance structure:
Code:
CREATE TABLE nature_reserve
(
the_id SERIAL PRIMARY KEY,
the_name VARCHAR
);
CREATE TABLE private_nature_reserve
(
) INHERITS (nature_reserve);
CREATE TABLE reserve_license
(
the_id SERIAL PRIMARY KEY,
the_reserve INTEGER REFERENCES private_nature_reserve(the_id)
);
When I run this script I get the following error:
Code:
ERROR: there is no unique constraint matching given keys for referenced table "private_nature_reserve"
So my question is: Aren't primary keys inherited in Postgres?