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)
> >




---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org


Reply via email to