Re: BUG #19964: ltree GiST index returns too few rows for lquery with a {0,n} quantifier

From: Aman Ganapathy <aman(at)stack-auth(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19964: ltree GiST index returns too few rows for lquery with a {0,n} quantifier
Date: 2026-12-02 22:55:42
Message-ID: CA+jUSqTF9qvNY7msH-K76DCQ3hHrp6ae4dbH6Q1ngc1U4nBJgQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Thank you so much! Will be more cautious with the tests next time.

Aman

On Wed, Dec 2, 2026 at 2:39 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Aman Ganapathy <aman(at)stack-auth(dot)com> writes:
> > I realized I forgot to attach my suggested patch and regression test.
> When
> > a GiST search on ltree reaches an internal page, gist_qe() skips the
> > subtree unless every label in the lquery is in the page's signature.
> That's
> > wrong for a level like c{0,1}: rows like x_y.b match without containing
> c,
> > so their subtrees get skipped.
>
> Pushed, after shortening the test additions a great deal. Expending
> lots and lots of cycles to test an edge case is not a win, and in
> this test script we already have a perfectly good test table to use.
>
> Thanks for the report and patch!
>
> regards, tom lane
>

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Jeff Davis 2026-12-02 22:55:51 Re: Regex fails to capture group consisting of empty string in non-greedy case
Previous Message Tom Lane 2026-12-02 22:52:23 Re: Regex fails to capture group consisting of empty string in non-greedy case