Adding another primary key to a populated table

Поиск
Список
Период
Сортировка
От Daniel Kunkel
Тема Adding another primary key to a populated table
Дата
Msg-id 1136520519.3321.44.camel@A64
обсуждение исходный текст
Ответы Re: Adding another primary key to a populated table  ("Jim C. Nasby" <jnasby@pervasive.com>)
Список pgsql-general
Hi

I'm trying to add another primary key to a table populated with data and
a number of foreign key constraints.

The new column is populated with non-null data (a requirement as I
understand it to become a valid primary key)

I tried:

ALTER TABLE product_price
   ADD CONSTRAINT product_price_pkey6 PRIMARY KEY
(product_id,product_price_type_id,currency_uom_id,product_store_group_id,from_date,product_price_purpose_id);

without having any luck.

Any suggestions?

Would it work to dump the database, edit the sql, and re-import?

Thanks in advance.

--
Daniel

*-.,,.-*"*-.,,.-*"*-.,,.-*"*-.,,.-*"*-.,,.-*"*-.,,.-*"*-.,,.-*"*-
Have a GREAT Day!

Daniel Kunkel           DanielKunkel@BioWaves.com
BioWaves, LLC           http://www.BioWaves.com
14150 NE 20th St. Suite F1
Bellevue, WA 98007
800-734-3588    425-895-0050
http://www.WizCity.com  http://www.Illusion-Optical.com
*-.,,.-*"*-.,,.-*"*-.,,.-*"*-.,,.-*"*-.,,.-*"*-.,,.-*"*-.,,.-*"*-


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

Предыдущее
От: Michael Fuhr
Дата:
Сообщение: Re: plpgsql question
Следующее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: Adding another primary key to a populated table