table inheritance and foreign key troubles

Поиск
Список
Период
Сортировка
От Kevin Way
Тема table inheritance and foreign key troubles
Дата
Msg-id 20010911080452.A76783@bean.overtone.org
обсуждение исходный текст
Ответы Re: table inheritance and foreign key troubles  (Christof Glaser <gcg@gl.aser.de>)
Список pgsql-sql
I'm having a little trouble with some inherited tables and a foreign key.  Here's
a simplified case, to show the trouble.

CREATE TABLE node (   node_id     SERIAL NOT NULL,   name        TEXT NOT NULL,   PRIMARY KEY (node_id)
);
-- works just fine

CREATE TABLE users (   email       TEXT NOT NULL
) INHERITS (node);
-- so far so good....

CREATE TABLE item (   reason      TEXT NOT NULL,   author_id   INT NOT NULL REFERENCES users (node_id)
) INHERITS (node);
ERROR:  UNIQUE constraint matching given keys for referenced table "users" not found

Does this operation just require differing syntax, because the referenced field
is inherited from another table, or is this not possible?

Kevin Way


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

Предыдущее
От: Jan Wieck
Дата:
Сообщение: Re: calling a shell script from pl/pgsql
Следующее
От: Miguel González
Дата:
Сообщение: SQL Query