Re: hex to decimal and back again - Mailing list pgsql-general

From Joe Conway
Subject Re: hex to decimal and back again
Date
Msg-id 3E89DEF3.8070400@joeconway.com
Whole thread Raw
In response to hex to decimal and back again  (Peter Nixon <listuser@peternixon.net>)
List pgsql-general
Peter Nixon wrote:
> I have some hex values which I am currently storing in varchar fields which
> I would like to convert to decimal integers to make sorting and indexing
> work correctly. I may need to convert them back to hex at some point for
> display but this is not strictly necessary. I can seem to find the right
> function to do this in postgres.
>

Is this what you need?

regression=# select x'ffff'::int4;
  int4
-------
  65535
(1 row)

HTH,

Joe


pgsql-general by date:

Previous
From: Joe Conway
Date:
Subject: Re: create type problem!
Next
From: Tom Lane
Date:
Subject: Re: create type problem!