Help with text(decimal) to hex conversion

Поиск
Список
Период
Сортировка
От Wei Shan
Тема Help with text(decimal) to hex conversion
Дата
Msg-id CAFe9ZTqUDZ_COnMWBb_XqXV5dAYcKjppf5dHSHaRNuBdZEBtvA@mail.gmail.com
обсуждение исходный текст
Ответы Re: Help with text(decimal) to hex conversion  (Gavin Flower <GavinFlower@archidevsys.co.nz>)
Re: Help with text(decimal) to hex conversion  (Szymon Lipiński <mabewlun@gmail.com>)
Re: Help with text(decimal) to hex conversion  (Merlin Moncure <mmoncure@gmail.com>)
Список pgsql-novice
Hi all,

There's a column that has datatype of text. The conversion will work fine for some of the rows.

psql> select to_hex(data::bigint)from table limit 5;
      to_hex
------------------
 499602d2
 499602d2
 4fa83d1136d920ef
 2e1b71785c8e11c
 53ff4c2824860fb8


However, for some records, the original data is too large for casting.

ERROR:  value "14481874327766585215" is out of range for type bigint

Any idea how to overcome this? to_hex function only accepts int or bigint.

Thanks!
--
Regards,
Ang Wei Shan

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

Предыдущее
От: Andreas Kretschmer
Дата:
Сообщение: Re: Initial performance tuning question
Следующее
От: JORGE MALDONADO
Дата:
Сообщение: Upgrading to a major version