Search Postgresql Archives

Re: How to create primary key

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

 



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

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

[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