RE: Direct converting numeric types to bool

Поиск
Список
Период
Сортировка
От Alex Ignatov
Тема RE: Direct converting numeric types to bool
Дата
Msg-id 0b9801d3b0a8$07818780$16849680$@postgrespro.ru
обсуждение исходный текст
Ответ на Direct converting numeric types to bool  (n.zhuchkov@postgrespro.ru)
Ответы Re: Direct converting numeric types to bool
Список pgsql-hackers
-----Original Message-----
From: n.zhuchkov@postgrespro.ru [mailto:n.zhuchkov@postgrespro.ru] 
Sent: Wednesday, February 28, 2018 6:04 PM
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Direct converting numeric types to bool

Attached patch allow direct convertion of numeric types to bool like
integer::bool.
Supported types:
  - smallint;
  - bigint;
  - real;
  - double precision;
  - decimal(numeric).

This functionality is helped with migration from Oracle.

--
Nikita Zhuchkov
Postgres Professional: http://www.postgrespro.com The Russian Postgres
Company

Hello!

What prevent us from:

postgres=# select 1::bigint::int::boolean;
 bool
------
 t
(1 row)

It is just one additional casting and required no additional patching
--
Alex Ignatov 
Postgres Professional: http://www.postgrespro.com 
The Russian Postgres Company



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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: postgres_fdw: perform UPDATE/DELETE .. RETURNING on a join directly
Следующее
От: Nikhil Sontakke
Дата:
Сообщение: Re: [HACKERS] logical decoding of two-phase transactions