Re: Casting INT4 to BOOL...

Поиск
Список
Период
Сортировка
От Sean Chittenden
Тема Re: Casting INT4 to BOOL...
Дата
Msg-id F9F6628E-1BB3-11D9-BCB2-000A95C705DC@speakeasy.net
обсуждение исходный текст
Ответ на Re: Casting INT4 to BOOL...  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Casting INT4 to BOOL...  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: Casting INT4 to BOOL...  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-patches
>> Is there any reason why the backend doesn't cast an unquoted integer
>> to
>> a boolean value?
>
> Hidden cross-category typecasts are evil.  I'd accept this as an
> explicit cast ('e' in pg_cast) but not automatic.
>
> Also, what about the other direction?  Providing a cast in only one
> direction is pretty inconsistent.

test=> SELECT 1::BOOL, 0::BOOL, TRUE::INT4, FALSE::INT4;
  bool | bool | int4 | int4
------+------+------+------
  t    | f    |    1 |    0
(1 row)

Okey doke, both directions are now provided and the cast has to be
explicit.  -sc



--
Sean Chittenden

Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: plperl features
Следующее
От: Sean Chittenden
Дата:
Сообщение: Re: Slightly better testing for pg_ctl(1)'s -w...