Re: REFERENCES ignored when there is inheritance? - Mailing list pgsql-general

From Stephane Bortzmeyer
Subject Re: REFERENCES ignored when there is inheritance?
Date
Msg-id 20050513120159.GA25857@nic.fr
Whole thread Raw
In response to REFERENCES ignored when there is inheritance?  (Stephane Bortzmeyer <bortzmeyer@nic.fr>)
List pgsql-general
On Fri, May 13, 2005 at 11:57:08AM +0200,
 Stephane Bortzmeyer <bortzmeyer@nic.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

pgsql-general by date:

Previous
From: Victor Spång Arthursson
Date:
Subject: Huge problem with upper/lower and foreign chars
Next
From: "Relyea, Mike"
Date:
Subject: Re: MS-Access and Stored procedures