Re: btree_gin: Incorrect leftmost interval value

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: btree_gin: Incorrect leftmost interval value
Дата
Msg-id 63b56dae-cfb6-4a84-ac8b-fd3a08ea1312@iki.fi
обсуждение исходный текст
Ответ на btree_gin: Incorrect leftmost interval value  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Список pgsql-hackers
On 27/10/2023 12:26, Dean Rasheed wrote:
> In contrib/btree_gin, leftmostvalue_interval() does this:
> 
> leftmostvalue_interval(void)
> {
>      Interval   *v = palloc(sizeof(Interval));
> 
>      v->time = DT_NOBEGIN;
>      v->day = 0;
>      v->month = 0;
>      return IntervalPGetDatum(v);
> }
> 
> which is a long way short of the minimum possible interval value.

Good catch!

> Attached is a patch fixing this by setting all the fields to their
> minimum values, which is guaranteed to be less than any other
> interval.

LGTM. I wish extractQuery could return "leftmost" more explicitly, so 
that we didn't need to construct these leftmost values. But I don't 
think that's supported by the current extractQuery interface.

-- 
Heikki Linnakangas
Neon (https://neon.tech)




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

Предыдущее
От: torikoshia
Дата:
Сообщение: Re: RFC: Logging plan of the running query
Следующее
От: Étienne BERSAC
Дата:
Сообщение: Re: RFC: Logging plan of the running query