BUG #15434: NUMERIC without any precision or scale truncates scale to 16 digits

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: parihaaraka(at)gmail(dot)com
Subject: BUG #15434: NUMERIC without any precision or scale truncates scale to 16 digits
Date: 2018-10-16 09:35:28
Message-ID: 15434-ced1c3ccf8209dc5@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 15434
Logged by: Andrey L
Email address: parihaaraka(at)gmail(dot)com
PostgreSQL version: 10.5
Operating system: Ubuntu 16.04
Description:

# select
1800000000000000001::numeric / (10^18)::numeric truncated, -- truncates to
16 digits after decimal point
1800000000000000001::numeric(48,18) / (10^18)::numeric correct,
1800000000000000001::numeric / (10^18)::numeric * (10^18)::numeric
to_be_sure;
truncated | correct | to_be_sure

--------------------+----------------------+--------------------------------------
1.8000000000000000 | 1.800000000000000001 |
1800000000000000000.0000000000000000
(1 row)

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Andrey 2018-10-16 10:04:47 Re: NOTIFY does not work as expected
Previous Message Amit Langote 2018-10-16 00:29:29 Re: BUG #15430: partition-wise join only works in combination with pruning on 1 partition