Re: Convert int to hex - Mailing list pgsql-sql

From Fernando Grijalba
Subject Re: Convert int to hex
Date
Msg-id f817a44d050602030451270b0f@mail.gmail.com
Whole thread Raw
In response to Convert int to hex  (Fernando Grijalba <fgrijalba@gmail.com>)
List 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 by date:

Previous
From: Richard Huxton
Date:
Subject: Re: [GENERAL] index row size 2728 exceeds btree maximum, 2713
Next
From: "Dinesh Pandey"
Date:
Subject: Re: [GENERAL] index row size 2728 exceeds btree maximum, 2713