Re: Negative value of numGroups

Поиск
Список
Период
Сортировка
Искать
От
Tom Lane
Тема
Re: Negative value of numGroups
Дата
в 15:34:17
Msg-id
1584431.1652801657@sss.pgh.pa.us
Ответ на
Список
Дерево обсуждения
Negative value of numGroups Andrey Lepikhov <a.lepikhov@postgrespro.ru>
Re: Negative value of numGroups Andrey Lepikhov <a.lepikhov@postgrespro.ru>
Re: Negative value of numGroups Tom Lane <tgl@sss.pgh.pa.us>
Re: Negative value of numGroups Andrey Lepikhov <a.lepikhov@postgrespro.ru>
Re: Negative value of numGroups Tom Lane <tgl@sss.pgh.pa.us>
Andrey Lepikhov  writes:
> On 13/5/2022 11:56, Andrey Lepikhov wrote:
>> (long) Min(numGroups, (double) LONG_MAX);
>> 
>> can return negative value, if numGroups > LONG_MAX.

I see your point, but I don't think that repeating the same finicky
and undocumented coding pattern in multiple places is a future-proof
fix.  I'm inclined to think we should invent a function along the
lines of "long clamp_double_to_long(double x)".  Given where it's
used, maybe putting it beside clamp_row_est() would be good.

			regards, tom lane


В списке pgsql-bugs по дате отправления
От: Andrey Lepikhov
Дата:
От: PG Bug reporting form
Дата:
FAQ