Re: Adding another primary key to a populated table

Поиск
Список
Период
Сортировка
От Jaime Casanova
Тема Re: Adding another primary key to a populated table
Дата
Msg-id c2d9e70e0601060813w51dbab69r27cc8b089f598da9@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Adding another primary key to a populated table  (Daniel Kunkel <DanielKunkel@BioWaves.com>)
Список 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 по дате отправления:

Предыдущее
От: "A. Kretschmer"
Дата:
Сообщение: Re: Reordering columns in a table
Следующее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: Arrays and Performance