Re: PRIMARY KEY not found? - Mailing list pgsql-general

From Stephan Szabo
Subject Re: PRIMARY KEY not found?
Date
Msg-id 20030802183024.E90895-100000@megazone.bigpanda.com
Whole thread Raw
In response to PRIMARY KEY not found?  ("Vernon Smith" <vwu98034@lycos.com>)
List pgsql-general
On Sat, 2 Aug 2003, Vernon Smith wrote:

>
> Here is the problem:
>
> Table A ( id int, ...)
> Table B ( ... ) inherits (A)
>
> CREATE TABLE C ( id int REFERENCES B ON DELETE CASCADE, ...);
>
> ERROR:  PRIMARY KEY for referenced table "B" not found
>
> It is fine when the reference is table A.
>
> Why?

I'm guessing that table A has a primary key on id?
Primary keys are not currently inherited, so you need to define
the key on B as well (and it doesn't guarantee uniqueness between
A and B)


pgsql-general by date:

Previous
From: "Vernon Smith"
Date:
Subject: PRIMARY KEY not found?
Next
From: Ron Johnson
Date:
Subject: Re: Inheritance & multiple-value fields