Inheritance of primary key - Mailing list pgsql-general

From Don Yury
Subject Inheritance of primary key
Date
Msg-id 378175E1.11B68DEF@vpcit.ru
Whole thread Raw
List 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 by date:

Previous
From: Vadim Mikheev
Date:
Subject: Re: [GENERAL] Stuck in a vacuum.
Next
From: Bruce Momjian
Date:
Subject: Re: [GENERAL] Auto-timeout on all queries