-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 11/06/07 03:15, Richard Huxton wrote:
> 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?
While I understand your feelings, I must disagree.
That's because adding a secondary index does not have the same sort
of syntax:
ALTER TABLE foo ADD INDEX (some, existing, columns);
> ALTER TABLE my_table ADD PRIMARY CONSTRAINT (existing_column);
>
> All in the manuals:
> http://www.postgresql.org/docs/8.2/static/sql-altertable.html
>
- --
Ron Johnson, Jr.
Jefferson LA USA
Give a man a fish, and he eats for a day.
Hit him with a fish, and he goes away for good!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFHMFr/S9HxQb37XmcRAuqfAKCzmYeBU4dVXorvQxBUYIoQuw9YcgCeOve1
NUtFo4N/sC4julpZmMvLN0s=
=qcCO
-----END PGP SIGNATURE-----