Re: How to create primary key

From: "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "Richard Huxton *EXTERN*" <dev(at)archonet(dot)com>, "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 13:40:28
Message-ID: D960CB61B694CF459DCFB4B0128514C27F7C41@exadv11.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Richard Huxton wrote:
>> What'd be the syntax to create a primary key on an already
>> build table?
>
> ALTER TABLE my_table ADD PRIMARY CONSTRAINT (existing_column);

I'm sure it's just a typo, but that is wrong.
It is not ADD PRIMARY CONSTRAINT, but ADD PRIMARY KEY.

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2007-11-06 13:43:47 Re: How to create primary key
Previous Message Kynn Jones 2007-11-06 13:03:21 Re: How to temporarily disable a table's FK constraints?