Re: Is Dropping a column "CHECK" constraint possible?

Поиск
Список
Период
Сортировка
От Christopher Kings-Lynne
Тема Re: Is Dropping a column "CHECK" constraint possible?
Дата
Msg-id 00e101c224a6$81ee3bc0$0200a8c0@SOL
обсуждение исходный текст
Ответ на Is Dropping a column "CHECK" constraint possible?  ("Rajesh Kumar Mallah." <mallah@trade-india.com>)
Ответы Re: Is Dropping a column "CHECK" constraint possible?  ("Rajesh Kumar Mallah." <mallah@trade-india.com>)
Re: Is Dropping a column "CHECK" constraint possible?  ("Rajesh Kumar Mallah." <mallah@trade-india.com>)
Список pgsql-sql

> can anyone please help?
> i have a to drop a check contstraint from a column. eg
> 
> tradein_clients=# \d t_a
>            Table "t_a"
>    Column   |  Type   | Modifiers
> ------------+---------+-----------
>  company_id | integer |
>  exp        | text    |
>  imp        | text    |
> Check constraints: "$1" (length(imp) > 1)
>                    "aaaaaq" (length(imp) > 1)
> 
> Can i remove to contraints thru ALTER TABLE or similar commands.
> I have read the docs for ALTER TABLE but the command described is 
> not working for me.

This should work, so long as you're using postgres 7.2+

ALTER TABLE "t_a" DROP CONSTRAINT "aaaaaq" RESTRICT;

Chris






В списке pgsql-sql по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: How do i return a dataset from a stored procedure
Следующее
От: "Rajesh Kumar Mallah."
Дата:
Сообщение: Re: Is Dropping a column "CHECK" constraint possible?