PRIMARY KEY

Started by Leitor de Listasabout 26 years ago2 messagesgeneral
Jump to latest
#1Leitor de Listas
listas@araketu.dcc.ufba.br

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.

Thanks in advance,
Gabriela.

#2Bruce Momjian
bruce@momjian.us
In reply to: Leitor de Listas (#1)
Re: PRIMARY KEY

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