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

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: BUG #18240: Undefined behaviour in cash_mul_flt8() and friends
Дата
Msg-id ZXgh74Ykj3iWvXKr@paquier.xyz
обсуждение исходный текст
Ответ на Re: BUG #18240: Undefined behaviour in cash_mul_flt8() and friends  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: BUG #18240: Undefined behaviour in cash_mul_flt8() and friends  (Bruce Momjian <bruce@momjian.us>)
Re: BUG #18240: Undefined behaviour in cash_mul_flt8() and friends  (David Rowley <dgrowleyml@gmail.com>)
Список pgsql-bugs
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

Вложения

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: BUG #18241: PushTransaction may cause Standby to execute ItemIdMarkDead
Следующее
От: Edouard Tollet
Дата:
Сообщение: Issue with pg_get_functiondef