Re: REFERENCES ignored when there is inheritance?

From: Stephane Bortzmeyer <bortzmeyer(at)nic(dot)fr>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: REFERENCES ignored when there is inheritance?
Date: 2005-05-13 12:01:59
Message-ID: 20050513120159.GA25857@nic.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, May 13, 2005 at 11:57:08AM +0200,
Stephane Bortzmeyer <bortzmeyer(at)nic(dot)fr> wrote
a message of 49 lines which said:

> I have 240 countries in the database. Because of a programming error,
> contacts were entered with a country > 240. I thought that the
> "REFERENCES Countries (id)" should have prevented it. Is it because of
> inheritance?

Yes, it is even documented :-(

http://www.postgresql.org/docs/7.4/interactive/ddl-inherit.html

I agree with the comments at the end. Having, as a workaround, to add
a FOREIGN KEY REFERENCES to every child table defeats a lot of the
purpose of inheritance.

It does not seem to be better in 8.0:

http://www.postgresql.org/docs/8.0/interactive/ddl-inherit.html

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Relyea, Mike 2005-05-13 12:12:04 Re: MS-Access and Stored procedures
Previous Message Victor Spång Arthursson 2005-05-13 11:25:02 Huge problem with upper/lower and foreign chars