Re: BUG #18240: Undefined behaviour in cash_mul_flt8() and friends

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, exclusion(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18240: Undefined behaviour in cash_mul_flt8() and friends
Date: 2023-12-12 10:37:19
Message-ID: ZXg33020jpsKYlCq@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, Dec 12, 2023 at 10:03:43AM +0100, Michael Paquier wrote:
> 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.

Yes, probably.

--
Bruce Momjian <bruce(at)momjian(dot)us> https://momjian.us
EDB https://enterprisedb.com

Only you can decide what is important to you.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2023-12-12 10:43:17 BUG #18242: pg_dump with non-superuser from pg14 to pg15 fails on ALTER FUNCTION
Previous Message Daniel Gustafsson 2023-12-12 10:20:31 Re: BUG #18224: message bug in libpqwalreceiver.c.