From: Tom Lane <tgl@sss.pgh.pa.us>
To: carlos_penteado@yahoo.com.br
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #14026: Problem to convert number to real
Date: Thu, 17 Mar 2016 19:25:29 -0400
Message-ID: <16337.1458257129@sss.pgh.pa.us> (raw)
In-Reply-To: <20160316200706.5227.26504@wrigleys.postgresql.org>
References: <20160316200706.5227.26504@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, carlos_penteado@yahoo.com.br
Subject: Re: BUG #14026: Problem to convert number to real
In-Reply-To: <16337.1458257129@sss.pgh.pa.us>
References: <20160316200706.5227.26504@wrigleys.postgresql.org> <16337.1458257129@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox