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

From Jaime Casanova
Subject Re: Adding another primary key to a populated table
Date
Msg-id c2d9e70e0601060813w51dbab69r27cc8b089f598da9@mail.gmail.com
Whole thread Raw
In response to Re: Adding another primary key to a populated table  (Daniel Kunkel <DanielKunkel@BioWaves.com>)
List pgsql-general
On 1/6/06, Daniel Kunkel <DanielKunkel@biowaves.com> wrote:
> Hi
>
> It makes sense that I can't have more than 1 primary key.
>
> Postgres was trying to create another primary key instead of modify the
> existing primary key.
>
> So...
>
> As I understand it, a table does not always have to have a primary key
> defined.
>
> Would it work to first delete/drop the primary key, then recreate the
> primary key on all 6 columns.
>

yes, but you have to drop all the dependant FOREIGN KEY constraints too

--
regards,
Jaime Casanova
(DBA: DataBase Aniquilator ;)

pgsql-general by date:

Previous
From: "A. Kretschmer"
Date:
Subject: Re: Reordering columns in a table
Next
From: "Jim C. Nasby"
Date:
Subject: Re: Arrays and Performance