Re: How to create primary key - Mailing list pgsql-general

From Richard Huxton
Subject Re: How to create primary key
Date
Msg-id 473030A0.4070600@archonet.com
Whole thread Raw
In response to How to create primary key  (Reg Me Please <regmeplease@gmail.com>)
Responses Re: How to create primary key  (Ron Johnson <ron.l.johnson@cox.net>)
Re: How to create primary key  ("Albe Laurenz" <laurenz.albe@wien.gv.at>)
List pgsql-general
Reg Me Please wrote:
> Hi all.
>
> What'd be the syntax to create a primary key on an already build table?

Hmm - so you want to sort of alter a table and add a primary key
constraint to an existing column?

ALTER TABLE my_table ADD PRIMARY CONSTRAINT (existing_column);

All in the manuals:
http://www.postgresql.org/docs/8.2/static/sql-altertable.html

--
   Richard Huxton
   Archonet Ltd

pgsql-general by date:

Previous
From: Reg Me Please
Date:
Subject: How to create primary key
Next
From: Reg Me Please
Date:
Subject: Re: Locale and indexes: howto?