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

From Daniel Kunkel
Subject Adding another primary key to a populated table
Date
Msg-id 1136520519.3321.44.camel@A64
Whole thread Raw
Responses Re: Adding another primary key to a populated table
List 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 by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: plpgsql question
Next
From: "Jim C. Nasby"
Date:
Subject: Re: Adding another primary key to a populated table