Обсуждение: (no subject)

Поиск
Список
Период
Сортировка

(no subject)

От
Olivier Detour
Дата:
I have a problem with inheritance and references.

TABLE parent_table (
id_parent SERIAL PRIMARY KEY,
....
)

No primary key in child
TABLE child_parent (
.....
) INHERITS (parent_table);

And another table :
TABLE other_table (
ref_child_table INTEGER REFERENCES parent_table
);

Reference must be take on parent_table, as child_parent inherit
parent_table's primary key. On child_table, it doesn't work (No primary
key in child_table).

So, it's ok for creating, but I can't do INSERT into other_table because
postgresql search primary key into parent_table instead into
child_table.

How can I do this ?
Please Help...