Search Postgresql Archives

Re: How to create primary key

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

---------------------------(end of broadcast)---------------------------TIP 6: explain analyze is your friend

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux