Search Postgresql Archives

Re: An amusing MySQL weakness--not!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
http://marica.fr/
Logiciel de gestion des sinistres et des contentieux pour le service juridique


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux