Re: Checking for string data that makes sense Re: postgresql vs mysql - Mailing list pgsql-general

From CaT
Subject Re: Checking for string data that makes sense Re: postgresql vs mysql
Date
Msg-id 20070222104003.GA13814@zip.com.au
Whole thread Raw
In response to Re: Checking for string data that makes sense Re: postgresql vs mysql  (Zoltan Boszormenyi <zboszor@dunaweb.hu>)
List 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

pgsql-general by date:

Previous
From: Zoltan Boszormenyi
Date:
Subject: Re: Checking for string data that makes sense Re: postgresql vs mysql
Next
From: "Rafa Comino"
Date:
Subject: Esay question, about the numeric format