Re: Drop a primary - Mailing list pgsql-general

From Ron
Subject Re: Drop a primary
Date
Msg-id f045cc6f-b553-a7e0-9b7f-989523d8a4ea@gmail.com
Whole thread Raw
In response to Drop a primary  (Martin Mueller <martinmueller@northwestern.edu>)
List 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 by date:

Previous
From: Martin Mueller
Date:
Subject: Drop a primary
Next
From: Michael Lewis
Date:
Subject: Re: Query Tuning