pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Haddon <tom@betterhealthfoundation.org>
To: pgsql-sql@postgresql.org
Subject: ALTER TABLE follow up
Date: Tue, 6 Aug 2002 15:41:08 -0700
Message-ID: <NEBBIHDGCLBEJMPFAMLACEMNCHAA.tom@betterhealthfoundation.org> (raw)

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
_______________________________




view thread (4+ messages)  latest in thread

Message-ID: <NEBBIHDGCLBEJMPFAMLACEMNCHAA.tom@betterhealthfoundation.org>
Permalink:  ../NEBBIHDGCLBEJMPFAMLACEMNCHAA.tom@betterhealthfoundation.org/
Also on:    postgresql.org/message-id/NEBBIHDGCLBEJMPFAMLACEMNCHAA.tom@betterhealthfoundation.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tom@betterhealthfoundation.org
  Subject: Re: ALTER TABLE follow up
  In-Reply-To: <NEBBIHDGCLBEJMPFAMLACEMNCHAA.tom@betterhealthfoundation.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox