Re: Drop column constraint - Mailing list pgsql-general

From Adrian Klaver
Subject Re: Drop column constraint
Date
Msg-id 6710083f-90d2-d111-45dd-e6f4162f825e@aklaver.com
Whole thread Raw
In response to Drop column constraint  (Rich Shepard <rshepard@appl-ecosys.com>)
Responses Re: Drop column constraint [FIXED]
List pgsql-general
On 10/30/20 8:30 AM, 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;

It should be:

alter table locations drop constraint 'constraint_name';

Where you can find 'constraint_name' from:

\d locations

> 
> 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
> 
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com



pgsql-general by date:

Previous
From: Rich Shepard
Date:
Subject: Drop column constraint
Next
From: Chris Sterritt
Date:
Subject: Re: Drop column constraint