Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id A8D52474E44 for ; Tue, 6 Aug 2002 18:41:11 -0400 (EDT) Received: from sterling.betterhealthfoundation.net (user-112ugh2.biz.mindspring.com [66.47.66.34]) by postgresql.org (Postfix) with ESMTP id 63F16474E71 for ; Tue, 6 Aug 2002 18:41:10 -0400 (EDT) Received: from dinar ([192.168.1.12]) by sterling.betterhealthfoundation.net with Microsoft SMTPSVC(5.0.2195.4905); Tue, 6 Aug 2002 15:41:08 -0700 From: "Tom Haddon" To: Subject: ALTER TABLE follow up Date: Tue, 6 Aug 2002 15:41:08 -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) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 X-OriginalArrivalTime: 06 Aug 2002 22:41:08.0091 (UTC) FILETIME=[5B01FCB0:01C23D9A] X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/119 X-Sequence-Number: 8965 Hi Folks, A follow up to the ALTER TABLE question last week. I had asked why I was getting an error message using the ALTER TABLE to add a PRIMARY KEY, and was told that this wasn't supported in 7.1.x. I've upgraded to 7.2.1 and now when I use the following SQL: ALTER TABLE "agency_contact_info" ADD CONSTRAINT "agency_contact_info_pkey" PRIMARY KEY NOT NULL ("id"); I get an error message saying that "Existing attribute "id" cannot be a PRIMARY KEY because it is not marked NOT NULL" How do I mark this as a NOT NULL to avoid the error message. The column in question is an INT4 field that has been "acquired" through a SELECT INTO statement. Is there some way that I can specify the qualities (NOT NULL, etc.) of the fields in a SELECT INTO statements? Thanks, Tom _______________________________ Tom Haddon IT Director The Better Health Foundation 414 Thirteenth Street, Suite 450 Oakland, CA 94612 (510) 444-5096 www.betterhealthfoundation.org _______________________________