Re: Adding another primary key to a populated table - Mailing list pgsql-general

From Andrew - Supernews
Subject Re: Adding another primary key to a populated table
Date
Msg-id slrndrrvfb.2iki.andrew+nonews@atlantis.supernews.net
Whole thread Raw
In response to Adding another primary key to a populated table  (Daniel Kunkel <DanielKunkel@BioWaves.com>)
Responses Re: Adding another primary key to a populated table  (Daniel Kunkel <DanielKunkel@BioWaves.com>)
List pgsql-general
On 2006-01-06, Daniel Kunkel <DanielKunkel@BioWaves.com> wrote:
> Hi
>
> I'm trying to add another primary key to a table populated with data and
> a number of foreign key constraints.

You can only have one primary key on a table.

You can add additional unique constraints to get the same effect. (A
primary key constraint is just a unique constraint that is also not null,
and is the default target for REFERENCES constraints referring to the table -
this last factor is why there can be only one...)

--
Andrew, Supernews
http://www.supernews.com - individual and corporate NNTP services

pgsql-general by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: Data loading from a flat file...
Next
From: Michael Fuhr
Date:
Subject: Re: Data loading from a flat file...