Received: from sss.pgh.pa.us ([192.204.191.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fB42Cnm40493 for ; Mon, 3 Dec 2001 21:12:49 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id fB42CLi20777; Mon, 3 Dec 2001 21:12:21 -0500 (EST) To: "Christopher Kings-Lynne" cc: "Ligia Pimentel" , pgsql-sql@postgresql.org Subject: Re: An easy question about creating a primary key In-reply-to: References: Comments: In-reply-to "Christopher Kings-Lynne" message dated "Tue, 04 Dec 2001 09:36:18 +0800" Date: Mon, 03 Dec 2001 21:12:21 -0500 Message-ID: <20774.1007431941@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200112/33 X-Sequence-Number: 5856 "Christopher Kings-Lynne" writes: > I have submitted code for 7.2b3 that allows ADD UNIQUE after table creation, > but you'll have to wait until 7.3 for ADD PRIMARY KEY after table createion. I think you've forgotten your own work, Chris. regression=# create table foo (bar int not null); CREATE regression=# alter table foo add primary key (bar); NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index 'foo_pkey' for table 'foo' CREATE regression=# Having to have marked the columns as "not null" from the beginning is a painful limitation, but it's not like the feature doesn't exist at all. regards, tom lane