Re: Casting INT4 to BOOL... - Mailing list pgsql-patches

From Andrew Dunstan
Subject Re: Casting INT4 to BOOL...
Date
Msg-id 1745.24.211.141.25.1097583640.squirrel@www.dunslane.net
Whole thread Raw
In response to Re: Casting INT4 to BOOL...  (Sean Chittenden <chitt@speakeasy.net>)
List 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



pgsql-patches by date:

Previous
From: "Dave Page"
Date:
Subject: Re: [pgsql-hackers-win32] Static build of libpq fails
Next
From: Reini Urban
Date:
Subject: Re: libpq.dll on win32