Re: BUG #19965: btree_gist index on timetz returns too few rows for <, > and <>

From: Aman Ganapathy <aman(at)stack-auth(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Kirill Reshke <reshkekirill(at)gmail(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19965: btree_gist index on timetz returns too few rows for <, > and <>
Date: 2026-12-03 18:31:47
Message-ID: CA+jUSqRC-z5NrUCxqsQhiQ=89142XqzHgFBKuGk-6nW1y4m-LA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Thank you for the patch!

Aman

On Thu, Dec 3, 2026 at 10:24 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Kirill Reshke <reshkekirill(at)gmail(dot)com> writes:
> > On Wed, 2 Dec 2026 at 21:58, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >> Interesting. Seems we need something like the attached.
>
> > Tested attached with regular and internal pages - it works on
> > unpatched binary GiST can miss a whole subtree of values.
>
> Thanks for testing!
>
> > If apply a similar fix to gbt_inet_consistent - some queries would
> > start to work - the case above would. Cases where ip address is
> > greater that another address by convert_network_to_scalar but lesses
> > in how 'inet' compares (network bytes + mask + whole addr) - not
> > fixed.So, ok, agree that these is a little value in fixing inet this
> > way
>
> I went ahead and added the same logic to gbt_inet_consistent.
> If somebody ever fixes its compression method, it's still going
> to need this, so we shouldn't make that somebody rediscover this
> bug the hard way.
>
> Pushed with that and test additions.
>
> regards, tom lane
>

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2026-12-03 18:34:02 Re: btree_gist: <-> fails on same-sign infinite intervals
Previous Message Tom Lane 2026-12-03 18:24:43 Re: BUG #19965: btree_gist index on timetz returns too few rows for <, > and <>