Inheritance of primary key

Поиск
Список
Период
Сортировка
От Don Yury
Тема Inheritance of primary key
Дата
Msg-id 378175E1.11B68DEF@vpcit.ru
обсуждение исходный текст
Список pgsql-general
Hi All.

I asked a question in group "novice" but haven't got an answer,
therefore decided to ask here.
How to inherit primary key?
For example, i have created tables
create table t1(
id int4  .... primary key
)

create table t2(
name text
)
inherits (t1)

and i would like to have id as a primary key in t2. But when i look at
the list of indexes in pg_index, i see there are t1_pkey - index for
primary key in t1, but don't see the same for t2, so id is not a primary
key in t2.

I tried

create table t2(
name text
primary key (id)
)
inherits (t1)

but got an error.

How i can make field id as a primary key in t2?
Thank you in advance.

Sincerely yours, Yury.
don.web-page.net, ICQ 11831432

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

Предыдущее
От: Vadim Mikheev
Дата:
Сообщение: Re: [GENERAL] Stuck in a vacuum.
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: [GENERAL] Auto-timeout on all queries