numeric to ipv6 inet

From: Mikhail Puzanov <misha(dot)puzanov(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: numeric to ipv6 inet
Date: 2013-08-23 09:56:21
Message-ID: CAJWC0jB4ZqrXi2RC9KLXb5mWsQuvc9u8H0-3p2_wOBP5k1c46Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

I need to convert the set of ipv6 addresses stored as numerics
(by historical reasons mostly) to inet type.

Something like
'0:0:0:0:0:0:0:0'::inet + 55831599345971591062080247067748335616::bigint
apparently doesn't work as the number added is too big to be converted to
bigint.

Is there any reasonable way to do it in sql/pgplsql?

Thanks in advance.

--
Best regards,
Mikhail V. Puzanov.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message sachin kotwal 2013-08-23 10:29:14 Re: filling database
Previous Message Vincent Veyron 2013-08-23 08:58:58 Re: Locale Issue