Re: Drop column constraint

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Rich Shepard <rshepard(at)appl-ecosys(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Drop column constraint
Date: 2020-10-30 15:37:27
Message-ID: 6710083f-90d2-d111-45dd-e6f4162f825e@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Chris Sterritt 2020-10-30 15:38:43 Re: Drop column constraint
Previous Message Rich Shepard 2020-10-30 15:30:50 Drop column constraint