From: Tom Lane <tgl@sss.pgh.pa.us>
To: Christopher Kings-Lynne <chriskl@familyhealth.com.au>
Cc: Ligia Pimentel <lmpimentel@yahoo.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: An easy question about creating a primary key
Date: Mon, 03 Dec 2001 21:12:21 -0500
Message-ID: <20774.1007431941@sss.pgh.pa.us> (raw)
In-Reply-To: <GNELIHDDFBOCMGBFGEFOOEKGCAAA.chriskl@familyhealth.com.au>
References: <GNELIHDDFBOCMGBFGEFOOEKGCAAA.chriskl@familyhealth.com.au>
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, chriskl@familyhealth.com.au, lmpimentel@yahoo.com
Subject: Re: An easy question about creating a primary key
In-Reply-To: <20774.1007431941@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox