Re: Convert int to hex

Поиск
Список
Период
Сортировка
От Fernando Grijalba
Тема Re: Convert int to hex
Дата
Msg-id f817a44d050602030451270b0f@mail.gmail.com
обсуждение исходный текст
Ответ на Convert int to hex  (Fernando Grijalba <fgrijalba@gmail.com>)
Список pgsql-sql
Thank you, I found out after I posted the message.

I did read the docs but must have looked somewhere else and I search
the lists for hex only and it did not bring the answer back.  It
wasn't until I search for int4 to hex that I was able to find the
answer.

Thank you again.

Fernando

On 6/1/05, Tony Wasson <ajwasson@gmail.com> wrote:
> On 6/1/05, Fernando Grijalba <fgrijalba@gmail.com> wrote:
> > I want to be able to change an int4 from a sequence and store it as
> > varchar in the database as a hex number.
> >
> > Is this possible?
> >
> > Thank you,
> >
> > Fernando
>
> Sure you can go from integer to hex and back...
> http://www.varlena.com/varlena/GeneralBits/104.php
>
> Here's the example queries to get you started.
>
>    =# select to_hex(11);
>     to_hex
>    --------
>     b
>    (1 row)
>
>    =# select x'ab'::integer;
>     int4
>    ------
>      171
>    (1 row)
>


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

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: [GENERAL] index row size 2728 exceeds btree maximum, 2713
Следующее
От: "Dinesh Pandey"
Дата:
Сообщение: Re: [GENERAL] index row size 2728 exceeds btree maximum, 2713