BUG #16755: A specification or a bug? Digit drop on CAST from DOUBLE PRECISION to NUMERIC.

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: hisanori(dot)kobayashi(dot)bp(at)nttdata(dot)com
Subject: BUG #16755: A specification or a bug? Digit drop on CAST from DOUBLE PRECISION to NUMERIC.
Date: 2020-12-01 07:07:29
Message-ID: 16755-9889c3ce84f837e3@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: 16755
Logged by: Kobayashi Hisanori
Email address: hisanori(dot)kobayashi(dot)bp(at)nttdata(dot)com
PostgreSQL version: 12.4
Operating system: Windows 10
Description:

Is this a specification? Or is it a bug?
In PostgreSQL 12.4 for Windows.

It would be understandable if the CAST from NUMERIC to DOUBLE PRECISION
would digit drop, but I don't know if it's a specification or a bug to digit
drop on CAST from DOUBLE PRECISION to NUMERIC. (translated by DeepL)

-----
postgres=> select (123456789012345::double precision * 11) ;
?column?
------------------
1.358024679135795e+15 <-- *** No Problem(No digit drop)

postgres=> select (123456789012345::double precision * 11)::numeric ;
numeric
------------------
1358024679135800 <-- *** Digit drop
-----

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2020-12-01 08:20:23 BUG #16756: about pg13.0 new feature--“Remove --adduser and --no-adduser from createuser”
Previous Message Michael Paquier 2020-12-01 06:01:33 Re: BUG #16663: DROP INDEX did not free up disk space: idle connection hold file marked as deleted