From: Michael Paquier <michael@paquier.xyz>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: exclusion@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18240: Undefined behaviour in cash_mul_flt8() and friends
Date: Tue, 12 Dec 2023 10:03:43 +0100
Message-ID: <ZXgh74Ykj3iWvXKr@paquier.xyz> (raw)
In-Reply-To: <2171714.1702307153@sss.pgh.pa.us>
References: <18240-c5da758d7dc1ecf0@postgresql.org>
<ZXbi3xo7QhQIe1YN@paquier.xyz>
<2171714.1702307153@sss.pgh.pa.us>
On Mon, Dec 11, 2023 at 10:05:53AM -0500, Tom Lane wrote:
> Yeah, approximately none of cash.c pays any attention to the risks
> of overflow/underflow. Improving that situation would be a good
> finger exercise for some aspiring hacker, perhaps. Although I bet
> somebody will ask again why it is that we continue to support the
> money type.
AFAIK, we discourage the use of money in the wiki for quite a few
years:
https://wiki.postgresql.org/wiki/Don%27t_Do_This#Don.27t_use_money
And numeric has much better code coverage and support. I am wondering
whether we've reached the point where it would be better to remove it
entirely from the tree, and just tell people to use numeric. This has
a cost for upgrades, where we should cross check for its use but there
is already check_for_data_type_usage() to do this job so the facility
is there.
--
Michael
Attachments:
signature.asc (application/pgp-signature, 832B) download
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: michael@paquier.xyz, tgl@sss.pgh.pa.us, exclusion@gmail.com, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18240: Undefined behaviour in cash_mul_flt8() and friends
In-Reply-To: <ZXgh74Ykj3iWvXKr@paquier.xyz>
* 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