Обсуждение: inheritance problems

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

inheritance problems

От
Matt
Дата:
I have a parent with two columns, the primary key; several children 
inherit these columns.

I can see all the childrens primary keys in the parent. however I can't 
reference data in the parent table that was entered into a child. I get 
a referential integrity violation. why is this? is there any way to 
change this behaviour. the purpose of haveing the parent was so that I 
could see the rows of two table in one place so that another table could 
indirectly reference the two of them. but this doesn't seem to behave 
the way it apears it should.

Thank you very much for considering my problem, any help would be 
greatly apreciated



Re: inheritance problems

От
Stephan Szabo
Дата:
On Fri, 14 Jun 2002, Matt wrote:

> I have a parent with two columns, the primary key; several children
> inherit these columns.
>
> I can see all the childrens primary keys in the parent. however I can't
> reference data in the parent table that was entered into a child. I get
> a referential integrity violation. why is this? is there any way to
> change this behaviour. the purpose of haveing the parent was so that I
> could see the rows of two table in one place so that another table could
> indirectly reference the two of them. but this doesn't seem to behave
> the way it apears it should.

Inheritance has a bunch of problems currently including the fact that
primary keys, unique constraint, foreign keys and triggers don't inherit.
Foreign keys currently reference from only the table the constraint is on
to only the table the constraint names specifically (and none of the
children).

Depending on how flexible you are with changes to schema, there have been
some discussions of workarounds in the past.