Re: postgresql vs mysql - Mailing list pgsql-general

From Chris
Subject Re: postgresql vs mysql
Date
Msg-id 45DD0D0C.8010701@gmail.com
Whole thread Raw
In response to postgresql vs mysql  (gustavo halperin <ggh.develop@gmail.com>)
Responses Checking for string data that makes sense Re: postgresql vs mysql  (Zoltan Boszormenyi <zboszor@dunaweb.hu>)
List pgsql-general
CaT wrote:
> On Thu, Feb 22, 2007 at 01:08:04PM +1100, Chris wrote:
>> In postgres, to stop an empty blank string:
>>
>> create table a(a text not null check (char_length(a) > 0));
>
> What's wrrong with using
>
> a <> ''
>
> sd the check? Or is this just a flavour thing?

Nothing, I just thought of the other way first :)

Probably better doing it as a <> '' otherwise postgres might have to run
the char_length function every time you do an insert (ie might be a very
slight performance issue).

--
Postgresql & php tutorials
http://www.designmagick.com/

pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Row-Level Access Control via FK to pg_catalog.pg_authid
Next
From: "John Smith"
Date:
Subject: Re: postgresql vs mysql