Re: Maximum limit on int in plpgsql - Mailing list pgsql-general

From Richard Huxton
Subject Re: Maximum limit on int in plpgsql
Date
Msg-id 41AC5714.1050405@archonet.com
Whole thread Raw
In response to Maximum limit on int in plpgsql  (deepthi@granwill.com)
Responses Re: Maximum limit on int in plpgsql
List pgsql-general
deepthi@granwill.com wrote:
> The i am taking the sum using this formula
>
> out_sum=ip1*256*256*256+ip2*256*256+ip3*256+ip4;
>
> When i run the procedure i am getting following error
> pg_atoi : Numerical result out of range
>
> I tried all possible datatypes but still i am getting the same error.
>
> Is it the problem of typecasting or the limits on datatype?

Type integer=int4 and is signed. IP addresses are unsigned. You'll need
to use an int8 to hold them.

--
   Richard Huxton
   Archonet Ltd

pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: Temporal query question
Next
From: "Nefnifi, Kasem"
Date:
Subject: starting the database server