Received: from web20203.mail.yahoo.com (web20203.mail.yahoo.com [216.136.226.58]) by postgresql.org (8.11.3/8.11.4) with SMTP id g19CvUE87449 for ; Sat, 9 Feb 2002 07:57:30 -0500 (EST) (envelope-from mindterm@yahoo.com) Message-ID: <20020209125733.30285.qmail@web20203.mail.yahoo.com> Received: from [202.134.78.133] by web20203.mail.yahoo.com via HTTP; Sat, 09 Feb 2002 04:57:33 PST Date: Sat, 9 Feb 2002 04:57:33 -0800 (PST) From: MindTerm Subject: Re: Adding a New Composite Constraint to an Existing Table. To: Bhuvan A , pgsql-sql@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Archive-Number: 200202/97 X-Sequence-Number: 6525 Dear Bhuvaneswar, Postgresql 7.2 has implemented this feature. For 7.1, I am afraid that you should recreate the table. M.T. --- Bhuvan A wrote: > > 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. > > > > ---------------------------(end of > broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org __________________________________________________ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com