ALTER TABLE follow up

From: "Tom Haddon" <tom(at)betterhealthfoundation(dot)org>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: ALTER TABLE follow up
Date: 2002-08-06 22:41:08
Message-ID: NEBBIHDGCLBEJMPFAMLACEMNCHAA.tom@betterhealthfoundation.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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
_______________________________

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Christopher Kings-Lynne 2002-08-07 02:02:09 Re: ALTER TABLE follow up
Previous Message rramostalo 2002-08-06 22:12:46 control reaches end of trigger procedure without RETURN