| From: | Nitin Motiani <nitinmotiani(at)google(dot)com> |
|---|---|
| To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
| Cc: | Dilip Kumar <dilipbalaut(at)gmail(dot)com>, alpkeles99(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org |
| Subject: | Re: BUG #19761: btree_gist: "cannot subtract infinite dates" when inserting 'infinity' into a GiST index on date |
| Date: | 2026-10-27 03:59:44 |
| Message-ID: | CAH5HC95brv15D73BQwdOoP53ueVtD+Qg+GPKsLqvEvKOSJLwyg@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-bugs |
On Mon, Oct 26, 2026 at 9:40 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> I think this is not there yet. An important behavior of the
> corresponding code for float8 (float_penalty_num_impl()) is that
> it makes the distance between two same-sign infinity values be zero,
> not infinity. This is mathematically wrong but we must do it for
> indexing purposes, else inserting multiple infinities will end up
> splitting each infinity onto its own index page when we want all
> identical infinities to pack onto as few index pages as possible.
>
> BTW, while checking this I happened to notice that
> gbt_float8_dist has a variant of the same problem:
>
> r = arg1 - arg2;
> if (unlikely(isinf(r)) && !isinf(arg1) && !isinf(arg2))
> float_overflow_error();
>
> I don't think we want an error thrown there either;
> returning the infinite distance (or DBL_MAX?) seems better.
>
Thanks a lot for the review, Tom. I'll be able to work on this in a
couple of weeks. Will look into it in detail and send the updated
patch at that time.
Regards,
Nitin Motiani
Google
| From | Date | Subject | |
|---|---|---|---|
| Next Message | David Rowley | 2026-10-27 04:12:19 | Re: BUG #19783: Sorted GROUPING SETS return a grouping column's value in a set that leaves it out |
| Previous Message | Peter Smith | 2026-10-27 03:36:31 | Re: Streaming decoding fails with "unexpected table_index_fetch_tuple call during logical decoding" when a relation has a TOASTed conbin (follow-up to BUG #18641) |