Search Postgresql Archives

Re: Drop a primary

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

 



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.

[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