Re: Adding another primary key to a populated table

From: "Jim Nasby" <jnasby(at)pervasive(dot)com>
To: <DanielKunkel(at)BioWaves(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Adding another primary key to a populated table
Date: 2006-01-06 19:34:34
Message-ID: D1D2D51E3BE3FC4E98598248901F759402C8908F@ausmail2k4.aus.pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Adding -general back in...

As someone else already mentioned, you can't have multiple primary keys on one table.

> From: Daniel Kunkel [mailto:DanielKunkel(at)BioWaves(dot)com]
> ERROR: ALTER TABLE / PRIMARY KEY multiple primary keys for table
> 'product_price' are not allowed
>
>
> On Thu, 2006-01-05 at 22:51 -0600, Jim C. Nasby wrote:
> > On Thu, Jan 05, 2006 at 08:08:39PM -0800, Daniel Kunkel wrote:
> > > 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_stor
> e_group_id,from_date,product_price_purpose_id);
> > >
> > > without having any luck.
> >
> > What's the exact error you got?
--
Jim C. Nasby, Sr. Engineering Consultant jnasby(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

Browse pgsql-general by date

  From Date Subject
Next Message Andreas Kretschmer 2006-01-06 19:39:59 Re: Reordering columns in a table
Previous Message Scott Ribe 2006-01-06 19:29:46 Re: 'Official' definition of ACID compliance?