Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-admin by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group