Re: PRIMARY KEY

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Leitor de Listas <listas(at)araketu(dot)dcc(dot)ufba(dot)br>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: PRIMARY KEY
Date: 2000-04-14 19:11:43
Message-ID: 200004141911.PAA26972@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

  • PRIMARY KEY at 2000-04-14 17:47:49 from Leitor de Listas

Browse pgsql-general by date

  From Date Subject
Next Message Brian Neal 2000-04-14 19:19:20 Re: database file size bloat
Previous Message The Hermit Hacker 2000-04-14 19:06:23 Re: Postgresqlism & Vacuum?