Re: BUG #14026: Problem to convert number to real

From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-bugs(at)postgresql(dot)org, carlos_penteado(at)yahoo(dot)com(dot)br
Subject: Re: BUG #14026: Problem to convert number to real
Date: 2016-03-17 23:18:52
Message-ID: 56EB3B5C.3020809@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 3/16/2016 1:07 PM, carlos_penteado(at)yahoo(dot)com(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Andres Freund 2016-03-17 23:21:37 Re: Too many files in pg_replslot folder
Previous Message Alvaro Herrera 2016-03-17 23:17:56 Re: BUG #14030: BRIN doc bug