Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aghIN-0007KC-VP for pgsql-bugs@arkaria.postgresql.org; Thu, 17 Mar 2016 23:25:36 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1aghIN-0004O5-I9 for pgsql-bugs@arkaria.postgresql.org; Thu, 17 Mar 2016 23:25:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1aghIN-0004Nz-9E for pgsql-bugs@postgresql.org; Thu, 17 Mar 2016 23:25:35 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1aghIJ-0004O0-N6 for pgsql-bugs@postgresql.org; Thu, 17 Mar 2016 23:25:34 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u2HNPTfU016338; Thu, 17 Mar 2016 19:25:29 -0400 From: Tom Lane To: carlos_penteado@yahoo.com.br cc: pgsql-bugs@postgresql.org Subject: Re: BUG #14026: Problem to convert number to real In-reply-to: <20160316200706.5227.26504@wrigleys.postgresql.org> References: <20160316200706.5227.26504@wrigleys.postgresql.org> Comments: In-reply-to carlos_penteado@yahoo.com.br message dated "Wed, 16 Mar 2016 20:07:06 -0000" Date: Thu, 17 Mar 2016 19:25:29 -0400 Message-ID: <16337.1458257129@sss.pgh.pa.us> 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 carlos_penteado@yahoo.com.br writes: > 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" means float8, while "real" means float4. Per http://www.postgresql.org/docs/9.5/static/datatype-numeric.html#DATATYPE-FLOAT PostgreSQL also supports the SQL-standard notations float and float(p) for specifying inexact numeric types. Here, p specifies the minimum acceptable precision in binary digits. PostgreSQL accepts float(1) to float(24) as selecting the real type, while float(25) to float(53) select double precision. Values of p outside the allowed range draw an error. float with no precision specified is taken to mean double precision. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs