X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 886DC3A5126 for ; Tue, 30 Nov 2004 10:14:20 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 44544-06 for ; Tue, 30 Nov 2004 10:14:12 +0000 (GMT) Received: from av7-1-sn4.m-sp.skanova.net (av7-1-sn4.m-sp.skanova.net [81.228.10.110]) by svr1.postgresql.org (Postfix) with ESMTP id B52D73A518B for ; Tue, 30 Nov 2004 10:14:13 +0000 (GMT) Received: by av7-1-sn4.m-sp.skanova.net (Postfix, from userid 502) id 8761F37E70; Tue, 30 Nov 2004 11:14:12 +0100 (CET) Received: from smtp2-1-sn4.m-sp.skanova.net (smtp2-1-sn4.m-sp.skanova.net [81.228.10.183]) by av7-1-sn4.m-sp.skanova.net (Postfix) with ESMTP id 78B3637E42; Tue, 30 Nov 2004 11:14:12 +0100 (CET) Received: from w128mtec (h191n1fls32o1108.telia.com [217.209.149.191]) by smtp2-1-sn4.m-sp.skanova.net (Postfix) with SMTP id 2E32137E42; Tue, 30 Nov 2004 11:14:10 +0100 (CET) Message-ID: <002a01c4d6c5$5b0ebb50$bf95d1d9@w128mtec> From: "mikael-aronsson" To: , References: <1101808087.41ac41d7382a9@granwill.com> Subject: Re: Maximum limit on int in plpgsql Date: Tue, 30 Nov 2004 11:14:17 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200411/234 X-Sequence-Number: 11656 Hi ! pg_atoi sounds like a function that converts from a string to an integer so the problem would be with the cast in that case, even though I cannot see any problem with your example. Mikael ----- Original Message ----- From: To: Sent: Tuesday, November 30, 2004 10:48 AM Subject: [JDBC] Maximum limit on int in plpgsql > Hello, > > I am passing the ip address as a varchar. Eg: 133.9.4.11 > > Later on i am splitting the ip address with the delimiter as '.' > > > ip1t:= split_part($1,'.',1); // returns a text value > ip2t:= split_part($1,'.',2); // returns a text value > ip3t:= split_part($1,'.',3); > ip4t:= split_part($1,'.',4); > > Then i am type casting it into an integer > > select into ip1 cast(ip1t as integer); > select into ip2 cast(ip2t as integer); > select into ip3 cast(ip3t as integer); > select into ip4 cast(ip4t as integer); > > 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? > > Thank you in advance, > deepthi > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/docs/faqs/FAQ.html