Re: Adding another primary key to a populated table

From: Jaime Casanova <systemguards(at)gmail(dot)com>
To: DanielKunkel(at)biowaves(dot)com
Cc: andrew(at)supernews(dot)com, pgsql-general(at)postgresql(dot)org
Subject: Re: Adding another primary key to a populated table
Date: 2006-01-06 16:13:18
Message-ID: c2d9e70e0601060813w51dbab69r27cc8b089f598da9@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 1/6/06, Daniel Kunkel <DanielKunkel(at)biowaves(dot)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 ;)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jim C. Nasby 2006-01-06 16:17:49 Re: Arrays and Performance
Previous Message A. Kretschmer 2006-01-06 16:07:35 Re: Reordering columns in a table