Dear all, I have some tables like below, and now i have one record for each in simple_texts, simple_directories and side_types. Now I want to insert one record into sides (from simple_directory to simple_text with side_type), but it report error: can not insert or update "sides", against foreign key "sides_from_fkey". detail: key (from)=(2) is not present in table "base_nodes". How does this happen? How to resolve? Thanks. --- CREATE TABLE base_nodes ( id bigserial NOT NULL UNIQUE ); CREATE TABLE name_descriptions ( name varchar (256) NOT NULL PRIMARY KEY, description text NOT NULL, UNIQUE (id) ) INHERITS (base_nodes); CREATE TABLE side_types ( UNIQUE (id), PRIMARY KEY (name) ) INHERITS (name_descriptions); CREATE TABLE sides ( "from" int8 NOT NULL REFERENCES base_nodes (id) ON DELETE CASCADE, "to" int8 NOT NULL REFERENCES base_nodes (id) ON DELETE CASCADE, "type" int8 NOT NULL REFERENCES side_types (id) ON DELETE CASCADE, PRIMARY KEY ("from", "to", "type") ) INHERITS (base_nodes); CREATE TABLE users ( "password" char (128) NOT NULL, UNIQUE (id), PRIMARY KEY (name) ) INHERITS (name_descriptions); CREATE TABLE simple_texts ( context text NOT NULL, UNIQUE (id), PRIMARY KEY (name) ) INHERITS (name_descriptions); CREATE TABLE simple_directories ( UNIQUE (id), PRIMARY KEY (name) ) INHERITS (name_descriptions);