From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: hisanori.kobayashi.bp@nttdata.com
Subject: BUG #16755: A specification or a bug? Digit drop on CAST from DOUBLE PRECISION to NUMERIC.
Date: Tue, 01 Dec 2020 07:07:29 +0000
Message-ID: <16755-9889c3ce84f837e3@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 16755
Logged by: Kobayashi Hisanori
Email address: hisanori.kobayashi.bp@nttdata.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
-----
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 using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, hisanori.kobayashi.bp@nttdata.com
Subject: Re: BUG #16755: A specification or a bug? Digit drop on CAST from DOUBLE PRECISION to NUMERIC.
In-Reply-To: <16755-9889c3ce84f837e3@postgresql.org>
* 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