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

From: "Rajesh Kumar Mallah(dot)" <mallah(at)trade-india(dot)com>
To: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Is Dropping a column "CHECK" constraint possible?
Date: 2002-07-07 13:45:10
Message-ID: 200207071915.10489.mallah@trade-india.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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)
> >

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message teknokrat 2002-07-07 18:40:19 manipulating the database in plsql
Previous Message Rajesh Kumar Mallah. 2002-07-07 13:36:02 Re: Can this be done with sql?