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 10:40:03
Message-ID: 20070222104003.GA13814@zip.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Feb 22, 2007 at 11:27:18AM +0100, Zoltan Boszormenyi wrote:
> >>I would do a CHECK (trim(a) <> '')
> >
> >Whitespaces are values too, you know.
>
> Yes, I know. But e.g. for a real people name, would you store
> accidentally entered spaces before or after the actual name, too?
> Which would also ruin sorting by name. But of course, it doesn't
> make sense in every case.

Yeah but if you're going down that path then you either trim on the
insert or use a trigger (rule?) to automatically trim your data for
you. Doing it in a check wont do much of anything for you in the case
you describe.

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Rafa Comino 2007-02-22 11:20:12 Esay question, about the numeric format
Previous Message Zoltan Boszormenyi 2007-02-22 10:27:18 Re: Checking for string data that makes sense Re: postgresql vs mysql