Re: Fix overflow hazard in interval rounding

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Fix overflow hazard in interval rounding
Дата
Msg-id 2715361.1707858079@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Fix overflow hazard in interval rounding  (Joseph Koshakow <koshy44@gmail.com>)
Список pgsql-hackers
Joseph Koshakow <koshy44@gmail.com> writes:
> On Tue, Feb 13, 2024 at 1:46 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> (We'd need ereport in back branches, but this problem seems to
>> me to probably not be worth back-patching.)

> Agreed, this seems like a pretty rare overflow/underflow.

OK, pushed to HEAD only.  I converted the second steps to be like
"a -= a%b" instead of "a = (a/b)*b" to make it a little clearer
that they don't have their own risks of overflow.  Maybe it's a
shade faster that way too, not sure.

            regards, tom lane



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

Предыдущее
От: Joseph Koshakow
Дата:
Сообщение: Re: Fix overflow hazard in interval rounding
Следующее
От: Justin Pryzby
Дата:
Сообщение: Re: pg_upgrade and logical replication