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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: aman(at)stack-auth(dot)com
Cc: 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-02 16:58:15
Message-ID: 1917149.1796230695@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

PG Bug reporting form <noreply(at)postgresql(dot)org> writes:
> A btree_gist index on a timetz column returns too few rows for <, > and
> <> when a stored value is the same UTC time as the comparison value with
> a different time zone offset, such as 09:00+00 and 10:00+01.

Interesting. Seems we need something like the attached.

The only other "inexact" opclass in btree_gist is the inet one,
which presumably is broken in a similar way. But that's so thoroughly
broken (because convert_network_to_scalar doesn't represent inet's
sort order faithfully) that this would not be enough to help it much.

regards, tom lane

Attachment Content-Type Size
fix-bug-19965.patch text/x-diff 935 bytes

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Sami Imseih 2026-12-02 17:58:58 Re: Anti-wraparound autovacuum stops for good after no slot available for new autovacuum worker process
Previous Message Fujii Masao 2026-12-02 16:52:57 Re: BUG #19967: ecpg crashes after "cursor does not exist" on FETCH or MOVE