Re: Drop column constraint

Поиск
Список
Период
Сортировка
От Chris Sterritt
Тема Re: Drop column constraint
Дата
Msg-id 01fb91c7-346f-a0ad-7d3b-9ccbde3aa56c@yobota.xyz
обсуждение исходный текст
Ответ на Drop column constraint  (Rich Shepard <rshepard@appl-ecosys.com>)
Список 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 по дате отправления:

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Drop column constraint
Следующее
От: Rich Shepard
Дата:
Сообщение: Re: Drop column constraint [FIXED]