Re: PRIMARY KEY not found?

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: PRIMARY KEY not found?
Дата
Msg-id 20030802183024.E90895-100000@megazone.bigpanda.com
обсуждение исходный текст
Ответ на PRIMARY KEY not found?  ("Vernon Smith" <vwu98034@lycos.com>)
Список 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 по дате отправления:

Предыдущее
От: "Vernon Smith"
Дата:
Сообщение: PRIMARY KEY not found?
Следующее
От: Ron Johnson
Дата:
Сообщение: Re: Inheritance & multiple-value fields