foreign key support for inheritance

From: Floyd Shackelford <shackman(at)fwshackelford(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: foreign key support for inheritance
Date: 2007-03-07 14:29:31
Message-ID: 45EECC4B.6040107@fwshackelford.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


i would like to suggest the following modification to the foreign key
syntax (and underlying implementation) to support table inheritance:

alter table [only] foo add foreign key (a_field) references [only] bar
(another_field) on delete restrict;

the only changes from the current syntax are the "[only]" modifiers
(pardon the pun) to the source and target tables. this modifier would
behave the same was as the "[only]" modifier in the "from [only]
foo_table" clause.

i really, really need foreign keys to support table inheritance. right
now, i have a script i run that generates 1000's of alter table commands
because i have to take into account not only the target table's
inheritance but the source table's inheritance too and all the
combinations of inheriting tables between them.

postgresql developers: please treat this as an enhancement request. i
think this would be a very popular enhancement.

--

Soli Deo gloria,

Floyd Shackelford

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-03-07 15:26:32 Re: postgres slower on nested queries
Previous Message Markus Schulz 2007-03-07 13:35:14 Default Cast type