Re: Maximum limit on int in plpgsql

From: Richard Huxton <dev(at)archonet(dot)com>
To: deepthi(at)granwill(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Maximum limit on int in plpgsql
Date: 2004-11-30 11:18:44
Message-ID: 41AC5714.1050405@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

deepthi(at)granwill(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Nefnifi, Kasem 2004-11-30 11:37:40 starting the database server
Previous Message Richard Huxton 2004-11-30 11:17:42 Re: Temporal query question