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

From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: "Rajesh Kumar Mallah(dot)" <mallah(at)trade-india(dot)com>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Is Dropping a column "CHECK" constraint possible?
Date: 2002-07-06 04:35:06
Message-ID: 00e101c224a6$81ee3bc0$0200a8c0@SOL
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Rajesh Kumar Mallah. 2002-07-06 05:03:16 Re: Is Dropping a column "CHECK" constraint possible?
Previous Message Bruce Momjian 2002-07-06 02:17:16 Re: How do i return a dataset from a stored procedure