Re: Adding another primary key to a populated table

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: Adding another primary key to a populated table
Дата
Msg-id 20060106074825.C27127@megazone.bigpanda.com
обсуждение исходный текст
Ответ на Re: Adding another primary key to a populated table  (Daniel Kunkel <DanielKunkel@BioWaves.com>)
Ответы Re: Adding another primary key to a populated table  (Daniel Kunkel <DanielKunkel@BioWaves.com>)
Список pgsql-general
On Thu, 5 Jan 2006, Daniel Kunkel wrote:

> 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.
>
> ALTER TABLE product_price DROP CONSTRAINT  product_price_pkey;
>
> I tried this, but it doesn't seem to work...  If I look at the table
> from pgAdmin, it is still there, reindexable, I can't add a new primary
> key, etc.  But if I try to run the above command twice, it says it's
> already been removed.

What version are you using?  The above sort of thing seems to work for me
on my 8.2 devel machine (in a small test, including recreating the key)
and I had thought it should on 8.1 as well.

В списке pgsql-general по дате отправления:

Предыдущее
От: John McCawley
Дата:
Сообщение: Reordering columns in a table
Следующее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: Reordering columns in a table