Search Postgresql Archives

Re: numeric to ipv6 inet

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2013/8/23, Mikhail Puzanov <misha.puzanov@xxxxxxxxx>:
> 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?
>


>From manual:
bigint 	
8 bytes 	
large-range integer 	-9223372036854775808 to 9223372036854775807

http://www.postgresql.org/docs/current/interactive/datatype-numeric.html#DATATYPE-INT

So 55831599345971591062080247067748335616 is out-of-range for a bigint.

Osvaldo


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux