ALTER TABLE follow up
От | Tom Haddon |
---|---|
Тема | ALTER TABLE follow up |
Дата | |
Msg-id | NEBBIHDGCLBEJMPFAMLACEMNCHAA.tom@betterhealthfoundation.org обсуждение исходный текст |
Ответы |
Re: ALTER TABLE follow up
|
Список | 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 _______________________________
В списке pgsql-sql по дате отправления: