Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aghCd-00071t-CP for pgsql-bugs@arkaria.postgresql.org; Thu, 17 Mar 2016 23:19:39 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1aghCc-0001wH-VI for pgsql-bugs@arkaria.postgresql.org; Thu, 17 Mar 2016 23:19:39 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1aghC0-0000xh-08 for pgsql-bugs@postgresql.org; Thu, 17 Mar 2016 23:19:00 +0000 Received: from hogranch.com ([75.101.82.47]) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aghBx-0007aT-49 for pgsql-bugs@postgresql.org; Thu, 17 Mar 2016 23:18:58 +0000 Received: from [192.168.0.2] (porker [192.168.0.2]) by hogranch.com (8.11.6/8.11.6) with ESMTP id u2HNIo711533; Thu, 17 Mar 2016 16:18:50 -0700 Subject: Re: BUG #14026: Problem to convert number to real To: pgsql-bugs@postgresql.org, carlos_penteado@yahoo.com.br References: <20160316200706.5227.26504@wrigleys.postgresql.org> From: John R Pierce Message-ID: <56EB3B5C.3020809@hogranch.com> Date: Thu, 17 Mar 2016 16:18:52 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <20160316200706.5227.26504@wrigleys.postgresql.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-HawgScanner-Information: Please contact the ISP for more information X-HawgScanner: Found to be clean X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On 3/16/2016 1:07 PM, carlos_penteado@yahoo.com.br wrote: > SELECT 109048.96::float, 0.96::float > RETURNS > 109048.96;0.96 > but > SELECT 109048.96::real, 0.96::real > RETURNS > 109049;0.96 float with unspecified precision is treated as double precision. real is by definition single precision, which is only accurate to around 6 digits. see http://www.postgresql.org/docs/current/static/datatype-numeric.html -- john r pierce, recycling bits in santa cruz -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs