Re: Is Dropping a column "CHECK" constraint possible? - Mailing list pgsql-sql

From Rajesh Kumar Mallah.
Subject Re: Is Dropping a column "CHECK" constraint possible?
Date
Msg-id 200207071915.10489.mallah@trade-india.com
Whole thread Raw
In response to Re: Is Dropping a column "CHECK" constraint possible?  ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>)
List pgsql-sql
Hi ,

i want to enforce that a coulumn 'imp'
shud either contain valid data or no data at all.

by valid data i mean data having at least one non whitespace character.

will this constraint be approprote for accomplishing it?

tradein_client=>  ALTER TABLE t_a ADD   CHECK ( length(  btrim(imp) ) > 1 or imp is NULL );

regards
mallah.




On Saturday 06 July 2002 10:05, Christopher Kings-Lynne wrote:
> > 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)
> >





pgsql-sql by date:

Previous
From: "Rajesh Kumar Mallah."
Date:
Subject: Re: Can this be done with sql?
Next
From: Roy Souther
Date:
Subject: Bad SUM result