Re: Drop a primary

Поиск
Список
Период
Сортировка
От Ron
Тема Re: Drop a primary
Дата
Msg-id f045cc6f-b553-a7e0-9b7f-989523d8a4ea@gmail.com
обсуждение исходный текст
Ответ на Drop a primary  (Martin Mueller <martinmueller@northwestern.edu>)
Список pgsql-general
On 10/2/19 1:48 PM, Martin Mueller wrote:

I created a primary key with the following commands

 

Add id serial

Add primary key (id)

 

I cannot figure out from the documentation how to drop that column.


Drop it just like you added it:

test=# alter table foobar add id serial;
ALTER TABLE
test=# alter table foobar add primary key(id);
ALTER TABLE
test=# alter table foobar drop id;
ALTER TABLE


--
Angular momentum makes the world go 'round.

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

Предыдущее
От: Martin Mueller
Дата:
Сообщение: Drop a primary
Следующее
От: Michael Lewis
Дата:
Сообщение: Re: Query Tuning