Inheritance of primary key

From: Don Yury <yura(at)vpcit(dot)ru>
To: pgsql-general(at)postgreSQL(dot)org
Subject: Inheritance of primary key
Date: 1999-07-06 03:20:01
Message-ID: 378175E1.11B68DEF@vpcit.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 1999-07-06 03:55:32 Re: [GENERAL] Auto-timeout on all queries
Previous Message Vadim Mikheev 1999-07-06 03:08:30 Re: [GENERAL] Stuck in a vacuum.