Re: How to create primary key

From: Richard Huxton <dev(at)archonet(dot)com>
To: Reg Me Please <regmeplease(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How to create primary key
Date: 2007-11-06 09:15:12
Message-ID: 473030A0.4070600@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Reg Me Please 2007-11-06 09:15:25 Re: Locale and indexes: howto?
Previous Message Reg Me Please 2007-11-06 08:54:58 How to create primary key