Re: More on inheritance and foreign keys - Mailing list pgsql-hackers

From Tom Lane
Subject Re: More on inheritance and foreign keys
Date
Msg-id 27827.1149779983@sss.pgh.pa.us
Whole thread Raw
In response to Re: More on inheritance and foreign keys  ("Zeugswetter Andreas DCP SD" <ZeugswetterA@spardat.at>)
Responses Re: More on inheritance and foreign keys  (Andreas Pflug <pgadmin@pse-consulting.de>)
List pgsql-hackers
"Zeugswetter Andreas DCP SD" <ZeugswetterA@spardat.at> writes:
>> The solution to the foreign key problem seems easy if I 
>> modify PostgreSQL implementation and take off the ONLY word 
>> from the SELECT query, but it's not an option for me, as I'm 

> I think that the ONLY was wrong from day one :-(

Well, sure, but until we have an implementation that actually *works*
across multiple tables, it has to be there so that we can at least
consistently support the current single-table semantics.  Until we
have some form of cross-table unique constraint (index or whatever)
we can't support multi-table foreign keys --- taking off the ONLY
is not a fix.

> Of course then we would need
>     REFERENCES tenk ONLY (unique1)
> to allow current behavior.

When we do have the support I'd be inclined to just change the
semantics.  I don't think we need to be backward compatible with
what everyone agrees is a bug.  (Also, your proposal would cover
having a non-inheritable referenced table, but what of inheritance
on the referencing side?)
        regards, tom lane


pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: ADD/DROP INHERITS
Next
From: Greg Stark
Date:
Subject: Re: ADD/DROP INHERITS