Re: Primary key on existing table?

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Carol Walter" <walterc(at)indiana(dot)edu>,<pgsql-admin(at)postgresql(dot)org>
Subject: Re: Primary key on existing table?
Date: 2009-08-25 21:55:57
Message-ID: 4A94179D020000250002A1CB@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Carol Walter <walterc(at)indiana(dot)edu> wrote:
> This may be a silly question but I don't see any place where the
> documentation explicitly addresses whether or not you can designate
> a particular column as a primary key after the table is created.

It sounds like you need ALTER TABLE DROP CONSTRAINT and ALTER TABLE
ADD table_constraint:

http://www.postgresql.org/docs/8.4/interactive/sql-altertable.html

-Kevin

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Ries van Twisk 2009-08-25 22:11:09 Re: Primary key on existing table?
Previous Message Carol Walter 2009-08-25 20:25:07 Primary key on existing table?