Re: postgresql vs mysql

From: Chris <dmagick(at)gmail(dot)com>
To: CaT <cat(at)zip(dot)com(dot)au>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: postgresql vs mysql
Date: 2007-02-22 03:25:00
Message-ID: 45DD0D0C.8010701@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John Smith 2007-02-22 05:11:13 Re: postgresql vs mysql
Previous Message CaT 2007-02-22 03:23:18 Re: postgresql vs mysql