pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedinheritance problems
3+ messages / 2 participants
[nested] [flat]
* inheritance problems
@ 2002-06-11 16:19 Matt <matthew.berardi@weilpublishing.com>
0 siblings, 0 replies; 3+ messages in thread
From: Matt @ 2002-06-11 16:19 UTC (permalink / raw)
To: pgsql-sql
I have a very general table, Orders, from which three other tables are
children. Orders has only two columns cid, oid, have primary key(oid,
cid). I want all the children to also have this primary key, and I want
uniqness of the primary key enforced accross all children. this was the
reason I decided to use inheritance, however I can insert the same entry
in two children and then look at the duplicates in the Orders :( is it
possible, and if so, how is it done; to have unique primary keys accross
all the children.
Matthew Berardi
WeilPublishing
^ permalink raw reply [nested|flat] 3+ messages in thread
* inheritance problems
@ 2002-06-14 17:38 Matt <matthew.berardi@weilpublishing.com>
0 siblings, 1 reply; 3+ messages in thread
From: Matt @ 2002-06-14 17:38 UTC (permalink / raw)
To: pgsql-sql
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
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: inheritance problems
@ 2002-06-14 20:03 Stephan Szabo <sszabo@megazone23.bigpanda.com>
parent: Matt <matthew.berardi@weilpublishing.com>
0 siblings, 0 replies; 3+ messages in thread
From: Stephan Szabo @ 2002-06-14 20:03 UTC (permalink / raw)
To: Matt <matthew.berardi@weilpublishing.com>; +Cc: pgsql-sql
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.
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2002-06-14 20:03 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-06-11 16:19 inheritance problems Matt <matthew.berardi@weilpublishing.com>
2002-06-14 17:38 inheritance problems Matt <matthew.berardi@weilpublishing.com>
2002-06-14 20:03 ` Stephan Szabo <sszabo@megazone23.bigpanda.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox