Hmm. I read my examples over and over, but as soon as it was emailed back to
me I noticed a mistake ;-)
In the second example, I had foreign key references to the derived table,
like so:
create table transfer (
id int8 primary key,
origownedid int8 references owned deferrable not null,
newownedid int8 references owned deferrable not null
) without oids;
And that working correctly is consistent with the first example. Changing it
to:
create table transfer (
id int8 primary key,
origownedid int8 references base deferrable not null,
newownedid int8 references base deferrable not null
) without oids;
Gives the constraint violation error, also consistent with the first
example.
So the behavior is consistent and easily explainable. Now my question is
reduced to: is this really correct behavior? Should a foreign key constraint
referencing a base table really not be satisfied by a row of a table that
inherits from the referenced base table??? That seems wrong to me.
--
Scott Ribe
scott_ribe@killerbytes.com http://www.killerbytes.com/
(303) 665-7007 voice
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faqs/FAQ.html