Re: BUG #4277: Feature request inet type cast numeric values

From: "Heikki Linnakangas" <heikki(at)enterprisedb(dot)com>
To: "x" <noreply(at)postgresql(dot)org>
Cc: <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #4277: Feature request inet type cast numeric values
Date: 2008-07-01 15:53:24
Message-ID: 486A52F4.6070309@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

x wrote:
> Description: Feature request inet type cast numeric values
> Details:
>
> SELECT inet 2130706433;
>
> Should return:
> ?column?
> --------
> 127.0.0.1
>
> This would emulate the functionality:
> CREATE OR REPLACE FUNCTION inet_ntoa(bigint) RETURNS text AS '
> SELECT (($1>>24) & 255::int8) || ''.'' ||
> (($1>>16) & 255::int8) || ''.'' ||
> (($1>>8) & 255::int8) || ''.'' ||
> ($1 & 255::int8) as result
> '
> LANGUAGE 'SQL';

You can create the cast yourself if you want to, see CREATE CAST.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2008-07-01 16:05:21 Re: BUG #4277: Feature request inet type cast numeric values
Previous Message x 2008-07-01 15:20:49 BUG #4277: Feature request inet type cast numeric values