Re: [PATCH] Check that index can return in get_actual_variable_range()

From: Aleksander Alekseev <aleksander(at)tigerdata(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Cc: Maxime Schoemans <maxime(dot)schoemans(at)enterprisedb(dot)com>, Mark Dilger <mark(dot)dilger(at)enterprisedb(dot)com>
Subject: Re: [PATCH] Check that index can return in get_actual_variable_range()
Date: 2025-09-19 08:20:52
Message-ID: CAJ7c6TN1y2nnaYS7xgeHg84BwaRnA_HA2QonezPTdO6VBuVQOA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Maxime,

> > Can you think of any test cases we can add to the code base?
>
> The only idea I have would be adding a new index module in src/test/modules that has this particular property and have a test that will hit get_actual_variable_range().
> For example, it could be a new access method that is a copy of btree, but whose amcanreturn property is null and that specifically sets scan->xs_itup to null in amgettuple.
>
> Without the patch, such a test would fail with 'ERROR: no data returned for index-only scan’, while with the patch it would pass.

Yes, this is how we typically test cases like this. IMO adding a test
module would be helpful. It can be reused for other scenarios.

--
Best regards,
Aleksander Alekseev

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Álvaro Herrera 2025-09-19 08:22:16 Re: Having postgresql.org link to cgit instead of gitweb
Previous Message Nazir Bilal Yavuz 2025-09-19 08:13:35 MinGW cross compilation failure on Debian trixie