pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bhuvan A <bhuvansql@yahoo.com>
To: pgsql-sql@postgresql.org
Subject: Adding a New Composite Constraint to an Existing Table.
Date: Sat, 9 Feb 2002 15:58:38 +0530 (IST)
Message-ID: <Pine.LNX.4.20.0202091548400.8097-100000@Larry.bks> (raw)


Hi,

I am using postgresql 7.1.  I was unable to add a new PRIMARY KEY
constraint to an existing table.

i have table,
CREATE TABLE xx
(
  id int,
  name text,
  amount int
);

I have say some 10 records in this table, which are unique and not
null (primary). Fine! Now, i am willing to have primary key constraint
to all the 3 fields.

I tried,

bhuvan=> ALTER TABLE xx ADD primary key (id, name, amount); 
ERROR:  ALTER TABLE / ADD CONSTRAINT is not implemented for that 
constraint type.

Where i am wrong? How else, can i get that primary key constraint
WITHOUT RECREATING that table?

Hope to get some lights.

Regards,
Bhuvaneswar.





view thread (3+ messages)  latest in thread

Message-ID: <Pine.LNX.4.20.0202091548400.8097-100000@Larry.bks>
Permalink:  ../Pine.LNX.4.20.0202091548400.8097-100000@Larry.bks/
Also on:    postgresql.org/message-id/Pine.LNX.4.20.0202091548400.8097-100000@Larry.bks

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: bhuvansql@yahoo.com
  Subject: Re: Adding a New Composite Constraint to an Existing Table.
  In-Reply-To: <Pine.LNX.4.20.0202091548400.8097-100000@Larry.bks>
  References: <Pine.LNX.4.20.0202091548400.8097-100000@Larry.bks>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox