Re: Casting INT4 to BOOL...

From: "Andrew Dunstan" <andrew(at)dunslane(dot)net>
To: <chitt(at)speakeasy(dot)net>
Cc: <sszabo(at)megazone(dot)bigpanda(dot)com>, <neilc(at)samurai(dot)com>, <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Casting INT4 to BOOL...
Date: 2004-10-12 12:20:40
Message-ID: 1745.24.211.141.25.1097583640.squirrel@www.dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Sean Chittenden said:
> Perl's
> decision to let any non-empty string be true doesn't mean a database
> should take any nonfalse-like value and assume it should be true.
> 42::BOOL == TRUE, on the other hand, has a long mathematical president
> wherein non-zero values are true and zero values are false.
>

(ITMY precedent)

FYI, perl does not quite do this. Both "" and "0" are false. Any other
string is true.

Of course, the Unix shell treats an exit value of 0 as success and non-zero
as failure, so the rule is hardly universal.

Personally, I would prefer to make boolean as opaque as possible. But I
don't care that much.

>
>
> ... I wonder what color this bikeshed is gunna be...

purple.

cheers

andrew

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Reini Urban 2004-10-12 16:22:33 Re: libpq.dll on win32
Previous Message Dave Page 2004-10-12 11:49:33 Re: Static build of libpq fails