Re: btree_gist: <-> fails on same-sign infinite intervals

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Raja Sai pranav <rajasaipranav0(at)gmail(dot)com>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: btree_gist: <-> fails on same-sign infinite intervals
Date: 2026-11-26 21:18:48
Message-ID: 1940489.1795727928@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Raja Sai pranav <rajasaipranav0(at)gmail(dot)com> writes:
> The attached patch does what ts_dist() now does: same-sign infinities
> are zero apart, any other infinite input is infinitely far. It adds
> tests to the interval test, which fail without the code change. It
> applies to master, REL_18_STABLE and REL_17_STABLE.

Agreed we should fix this, but you've not fully duplicated the
fixes from 15b3dc140: since you still use interval_mi, it's
still possible to get an overflow error. I think you need to
inline what finite_interval_mi() does and substitute infinity
in the cases where it throws an error.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Raja Sai pranav 2026-11-26 21:22:00 Re: BUG #19928: pg_upgrade fails on v18 schema with NOT NULL ... NO INHERIT and inheritance
Previous Message Tom Lane 2026-11-26 20:25:59 Re: BUG #19873: planner silently drops the second ORDER BY sort key when both keys reference the same expression und