Re: How to create primary key

Поиск
Список
Период
Сортировка
От Ron Johnson
Тема Re: How to create primary key
Дата
Msg-id 47305AFF.7010908@cox.net
обсуждение исходный текст
Ответ на Re: How to create primary key  (Richard Huxton <dev@archonet.com>)
Список pgsql-general
-----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-----

В списке pgsql-general по дате отправления:

Предыдущее
От: "Albe Laurenz"
Дата:
Сообщение: Re: How to create primary key
Следующее
От: "Hristo Filipov"
Дата:
Сообщение: Re: How to transfer from place to plase without backup/restore