Re: Drop a primary

From: Ron <ronljohnsonjr(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Drop a primary
Date: 2019-10-02 18:52:54
Message-ID: f045cc6f-b553-a7e0-9b7f-989523d8a4ea@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michael Lewis 2019-10-02 19:32:24 Re: Query Tuning
Previous Message Martin Mueller 2019-10-02 18:48:17 Drop a primary