Re: Casting INT4 to BOOL...

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: Casting INT4 to BOOL...
Дата
Msg-id 1745.24.211.141.25.1097583640.squirrel@www.dunslane.net
обсуждение исходный текст
Ответ на Re: Casting INT4 to BOOL...  (Sean Chittenden <chitt@speakeasy.net>)
Список 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 по дате отправления:

Предыдущее
От: "Dave Page"
Дата:
Сообщение: Re: [pgsql-hackers-win32] Static build of libpq fails
Следующее
От: Reini Urban
Дата:
Сообщение: Re: libpq.dll on win32