Re: Primary Key on Inherited Table

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Primary Key on Inherited Table
Дата
Msg-id 15146.957906628@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Primary Key on Inherited Table  (Wenjin Zheng <wenjin.zheng@lsbc.com>)
Список pgsql-hackers
Wenjin Zheng <wenjin.zheng@lsbc.com> writes:
> Is there a way to specify primary key in the child table using columns
> from parent table?  I am using 6.5.0.

It sounds like the PRIMARY KEY spec is getting processed before the
parent table reference is expanded.  That's probably a bug, but it's
not going to get fixed in 6.5 ;-).  What I'd suggest is not relying
on the PRIMARY KEY syntax, but just writing out the equivalent CREATE
UNIQUE INDEX command separately after you create the child table.

(Strictly speaking, PRIMARY KEY also implies NOT NULL on each column,
which might be hard to duplicate if you don't want the same columns
to be NOT NULL in the parent, but as long as you can set them that
way in the parent you don't need PRIMARY KEY.)
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Henry B. Hotz"
Дата:
Сообщение: Re: You're on SecurityFocus.com for the cleartext passwords.
Следующее
От: The Hermit Hacker
Дата:
Сообщение: Re: misc questions