Skip site navigation (1) Skip section navigation (2)

Re: An amusing MySQL weakness--not!

From: Vincent Veyron <vv(dot)lists(at)wanadoo(dot)fr>
To: Leif Biberg Kristensen <leif(at)solumslekt(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: An amusing MySQL weakness--not!
Date: 2011-06-27 12:48:20
Message-ID: 1309178900.2381.81.camel@asus-1001PX.home (view raw or whole thread)
Lists: pgsql-general
Le lundi 27 juin 2011 à 12:11 +0200, Leif Biberg Kristensen a écrit :
> PHP has its own Boolean values TRUE/FALSE, but reads Postgresql
> Booleans as 
> 't'/'f'. You always have to rely on kludgy konstructs like
> if ($pg_bool == 't') then
>     $my_bool = TRUE;
> elseif ($pg_bool == 'f') then
>     $my_bool = FALSE;
> else
>     $my_bool = NULL;
> It's of course much easier to use integer values, but it sucks not to
> use a 
> bool when you want a variable that can't be anything but TRUE, FALSE
> or NULL.

Same thing with Perl. 

But I am starting to think that the benefits of data integrity
mentionned by Stephen are worth the extra effort : you save on
validation needs anyway, which is probably another couple of lines, if
not more, and less reliable.

Vincent Veyron
Logiciel de gestion des sinistres et des contentieux pour le service juridique

In response to

pgsql-general by date

Next:From: Guillaume LelargeDate: 2011-06-27 12:57:23
Subject: Re: discard on constraint violation
Previous:From: Sim ZacksDate: 2011-06-27 12:36:48
Subject: discard on constraint violation

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group