Re: Fix BRIN numeric_minmax_multi_ops out of range value range merging

From: Tomas Vondra <tomas(at)vondra(dot)me>
To: shihao zhong <zhong950419(at)gmail(dot)com>
Cc: Kirill Reshke <reshkekirill(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Fix BRIN numeric_minmax_multi_ops out of range value range merging
Date: 2026-11-02 22:49:05
Message-ID: 1173fbe5-a8dc-4941-87a9-ec79362df214@vondra.me
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 10/31/26 05:11, shihao zhong wrote:
> Hi Tomas,
>
> Thanks for your patch.. 
>
> I think your code is right, the subtraction only fails when the result
> is too
> big for numeric.  
>
> Two small things.
>
> 1. A NaN boundary gives a NaN distance. The
> brin_minmax_multi_distance_numeric
> return infinity there.
>
> 2. In 0004, GiST can call numrange_subdiff with v1 < v2. Overflow
> there should give -infinity, not +infinity.
>

Thanks. I've pushed the three BRIN fixes. Here's an updated fix for the
multirange issue, with the -infinity for (v1 < v2).

regards

--
Tomas Vondra

Attachment Content-Type Size
0001-Handle-overflow-when-analyzing-nummultirange-values.patch text/x-patch 4.6 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message surya poondla 2026-11-02 23:03:59 Re: Fix trigger memory leak
Previous Message Jeff Davis 2026-11-02 22:33:21 Re: [RFC] Property-based testing for Postgres