Richard Guo <guofenglinux@gmail.com> writes:
> On Fri, Aug 1, 2025 at 3:17 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> We've known about this for, um, decades: btree_gist's support for
>> inet/cidr is fundamentally broken [1][2]. It's still there
>> only because nobody's been able to think of a way of removing it
>> without causing pain for anyone who has indexes like that.
>> But maybe we should just accept that it's going to cause pain
>> and remove it.
> I think correctness should take priority over avoiding pain.
Yeah. I spent a little time investigating this today, and hope
to have a patch to propose tomorrow.
What I debugged yesterday was, in gbt_inet_consistent(),
query = convert_network_to_scalar(dquery, INETOID, &failure);
(gdb) p query
$2 = 11822170368
then in gbt_num_consistent(), called tinfo->f_lt(query, key->upper, flinfo), which is gbt_inetlt()
and
(gdb) p *(double *) b
$5 = 11822170368
a is equal to b, gbt_inet_consistent() returned false, no index tuple found.
--