Re: Checking for string data that makes sense Re: postgresql vs mysql

From: CaT <cat(at)zip(dot)com(dot)au>
To: Zoltan Boszormenyi <zboszor(at)dunaweb(dot)hu>
Cc: Chris <dmagick(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Checking for string data that makes sense Re: postgresql vs mysql
Date: 2007-02-22 09:39:32
Message-ID: 20070222093932.GH3107@zip.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Feb 22, 2007 at 09:13:13AM +0100, Zoltan Boszormenyi wrote:
> Chris ?rta:
> >CaT wrote:
> >>On Thu, Feb 22, 2007 at 01:08:04PM +1100, Chris wrote:
> >>>create table a(a text not null check (char_length(a) > 0));
> >>
> >>What's wrrong with using
> >>
> >>a <> ''
> >
> >Nothing, I just thought of the other way first :)
>
> I would do a CHECK (trim(a) <> '')

Whitespaces are values too, you know.

--
"To the extent that we overreact, we proffer the terrorists the
greatest tribute."
- High Court Judge Michael Kirby

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ron Johnson 2007-02-22 09:55:52 Re: postgresql vs mysql
Previous Message Shashank Tripathi 2007-02-22 09:10:08 Re: Checking for string data that makes sense Re: postgresql vs mysql