Re: casting BOOL to somthng

Поиск
Список
Период
Сортировка
От Michael Glaesemann
Тема Re: casting BOOL to somthng
Дата
Msg-id 8618C5BA-FB54-11D8-A2A0-000A95C88220@myrealbox.com
обсуждение исходный текст
Ответ на Re: casting BOOL to somthng  (sad <sad@bankir.ru>)
Ответы Re: casting BOOL to somthng  (sad <sad@bankir.ru>)
Список pgsql-sql
On Aug 31, 2004, at 8:24 PM, sad wrote:

> and i am still desire to know _WHY_ there are no predefined cast for 
> BOOL ?
> and at the same time there are predefined casts for INT and FLOAT......

I think the main reason is what is the proper textual representation of 
BOOLEAN? True, PostgreSQL returns 't' as a representation for the 
BOOLEAN value TRUE, but some people might want it to return 'TRUE' or 
'true' or other representations. Picking one is perhaps arbitrary.

In a similar vein, some people would like to cast BOOLEAN to INTEGER, 
as often BOOLEAN TRUE and BOOLEAN FALSE are represented as INTEGER 1 
and INTEGER 0, respectively, in some systems. However, other systems 
use different INTEGER representations such as INTEGER 1 and INTEGER -1 
for BOOLEAN TRUE and FALSE, respectively. Again, the choice of how to 
cast BOOLEAN to INTEGER is kind of arbitrary.

Luckily PostgreSQL provides convenient ways of making user-defined 
casts.

Just my thoughts.

Michael Glaesemann
grzm myrealbox com



В списке pgsql-sql по дате отправления:

Предыдущее
От: Rajesh Kumar Mallah
Дата:
Сообщение: Re: Arbitrary precision arithmatic with pgsql
Следующее
От: Jan Wieck
Дата:
Сообщение: Re: Arbitrary precision arithmatic with pgsql