Re: What's the logical counterpart of the to_hex function?

From: "Michael Nolan" <htfoot(at)gmail(dot)com>
To: "Steve Atkins" <steve(at)blighty(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: What's the logical counterpart of the to_hex function?
Date: 2007-07-17 12:48:11
Message-ID: 4abad0eb0707170548l6df0081ci60cbc18821f3d505@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 7/16/07, Steve Atkins <steve(at)blighty(dot)com> wrote:
>
>
> On Jul 16, 2007, at 11:36 AM, Michael Nolan wrote:
>
> > I have data (from an external source) which is in text format as a
> > hex number (it's actually an IP address, but that's probably not
> > relevant.)
>
> It likely is relevant, as it means it's a 32 bit unsigned integer,
> which isn't something postgresql supports. Depending on what you need
> you might want to look at using 32 bit signed, with a 2^31 offset, 64
> bit signed, inet or ip4 (which is on pgfoundry, not built-in).

Actually, since what I need are the 4 dotted tuples, all I really need is a
simple way to convert a two byte hex field to an integer, it sounds like the
exec is the preferred (though IMHO clumsy) method.

--
Mike Nolan

In response to

Browse pgsql-general by date

  From Date Subject
Next Message ann hedley 2007-07-17 12:51:21 average/stddev on all values returned by a select distinct
Previous Message Pavel Stehule 2007-07-17 10:14:19 Re: ERROR: a column definition list is required for functions returning "record"