Re: Hex Integer Input

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Hex Integer Input
Дата
Msg-id 1000.1047057194@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Hex Integer Input  (Achilleus Mantzios <achill@matrix.gatewaynet.com>)
Ответы Re: Hex Integer Input  (Achilleus Mantzios <achill@matrix.gatewaynet.com>)
Список pgsql-sql
Achilleus Mantzios <achill@matrix.gatewaynet.com> writes:
> Hi, is there a way to enter integer data by their HEX
> representation??

I'm not sure that this is SQL-spec, but at least as of 7.3, you can
coerce a bitstring literal to int, so:

z=# select x'0f';?column?
----------00001111
(1 row)

z=# select x'0f'::int4;int4
------  15
(1 row)

Looks like it works for int8 as well.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Underscores in column names
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: How to notice column changes in trigger