Re: More on inheritance and foreign keys

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Zeugswetter Andreas DCP SD" <ZeugswetterA(at)spardat(dot)at>
Cc: "Albert Cervera Areny" <albertca(at)hotpop(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: More on inheritance and foreign keys
Date: 2006-06-08 15:19:43
Message-ID: 27827.1149779983@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Zeugswetter Andreas DCP SD" <ZeugswetterA(at)spardat(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2006-06-08 15:42:49 Re: ADD/DROP INHERITS
Previous Message Greg Stark 2006-06-08 15:19:25 Re: ADD/DROP INHERITS