Re: Drop column constraint - Mailing list pgsql-general

From Chris Sterritt
Subject Re: Drop column constraint
Date
Msg-id 01fb91c7-346f-a0ad-7d3b-9ccbde3aa56c@yobota.xyz
Whole thread Raw
In response to Drop column constraint  (Rich Shepard <rshepard@appl-ecosys.com>)
List pgsql-general
On 30/10/2020 15:30, Rich Shepard wrote:
> A table has a unique constraint on a column that needs removing. 
> Reading the
> postgres-12.x docs for alter table it appears the correct syntax is:
>
> alter table locations drop constraint unique;
>
> but this is wrong.
>
> Trying 'alter table locations alter column loc_nbr drop constraint 
> unique;' also
> failed.
>
> What's the proper syntax to drop the unique constraint on a table column?
>
> TIA,
>
> Rich
>
>
>
You need

alter table locations drop constraint <constraint name>;


Cheers, Chris Sterritt




pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Drop column constraint
Next
From: Rich Shepard
Date:
Subject: Re: Drop column constraint [FIXED]