Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id C497E476365 for ; Fri, 2 Aug 2002 19:16:36 -0400 (EDT) Received: from sterling.betterhealthfoundation.net (user-112ugh2.biz.mindspring.com [66.47.66.34]) by postgresql.org (Postfix) with ESMTP id 1361547621D for ; Fri, 2 Aug 2002 19:16:36 -0400 (EDT) Received: from dinar ([192.168.1.12]) by sterling.betterhealthfoundation.net with Microsoft SMTPSVC(5.0.2195.4905); Fri, 2 Aug 2002 16:16:37 -0700 From: "Tom Haddon" To: Subject: Add Primary Key to a Table Date: Fri, 2 Aug 2002 16:16:36 -0700 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 Importance: Normal X-OriginalArrivalTime: 02 Aug 2002 23:16:37.0065 (UTC) FILETIME=[A652A390:01C23A7A] X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/49 X-Sequence-Number: 8895 Hi Folks, I'm trying to use the ALTER TABLE command to add a primary key to a table. The command I am using is: ALTER TABLE "agency_contact_info" ADD CONSTRAINT "agency_contact_info_pkey" PRIMARY KEY ("id"); I get a message saying "ALTER TABLE / ADD CONSTRAINT not implemented for that constraint type". Is this a bug, or am I doing something wrong? The reason I am trying to do this is that I want to split a table with a large number of fields up into a few tables with a sub-set of fields from the original table, linked by FOREIGN KEY on "id". I had thought the best way to do this was to use SELECT INTO and then try to alter the tables to include PRIMARY and FOREIGN keys where applicable. Is there a better way to do this? Thanks, Tom _______________________________ Tom Haddon IT Director The Better Health Foundation 414 Thirteenth Street, Suite 450 Oakland, CA 94612 (510) 444-5096 www.betterhealthfoundation.org _______________________________