Re: PRIMARY KEY - Mailing list pgsql-general

From Bruce Momjian
Subject Re: PRIMARY KEY
Date
Msg-id 200004141911.PAA26972@candle.pha.pa.us
Whole thread Raw
In response to PRIMARY KEY  (Leitor de Listas <listas@araketu.dcc.ufba.br>)
List pgsql-general
>
> Hi people,
>
> Does anybody happen to know how I can alter a user table to include the
> primary key? I'm using the beta4 version of Postgresql7.0, and I'm aware
> that the primary key has already been implemented. I've tried to do ALTER
> TABLE ADD CONSTRAINT PRIMARY KEY but it didn't work.
>

Well, in the pre-foreign key days, an unique not null column was the
same as primary key.  Now foreign keys refer to them as special.  I
don't think ALTER TABLE supports PRIMARY KEY changes, though it should.

--
  Bruce Momjian                        |  http://www.op.net/~candle
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

pgsql-general by date:

Previous
From: Colin Smith
Date:
Subject: Re: [Fwd: [HACKERS] Porting reports (cont'd)]
Next
From: Ed Loehr
Date:
Subject: Re: PostgreSQL (fwd)