Re: Adding another primary key to a populated table

From: Andrew - Supernews <andrew+nonews(at)supernews(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Adding another primary key to a populated table
Date: 2006-01-06 05:19:39
Message-ID: slrndrrvfb.2iki.andrew+nonews@atlantis.supernews.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2006-01-06, Daniel Kunkel <DanielKunkel(at)BioWaves(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Fuhr 2006-01-06 05:48:46 Re: Data loading from a flat file...
Previous Message Michael Fuhr 2006-01-06 05:05:45 Re: Data loading from a flat file...