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

Maxime Schoemans <maxime.schoemans@enterprisedb.com>

From: Maxime Schoemans <maxime.schoemans@enterprisedb.com>
To: Aleksander Alekseev <aleksander@tigerdata.com>
Cc: pgsql-hackers@lists.postgresql.org, Mark Dilger <mark.dilger@enterprisedb.com>
Date: 2025-09-22T14:38:53Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Check that index can return in get_actual_variable_range()

  2. Fix crash/valgrind error

  3. Support non-btree indexes in get_actual_variable_range()

Attachments

On 19 Sep 2025, at 10:20, Aleksander Alekseev <aleksander@tigerdata.com>
wrote:

> 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.

Here is an updated patch set.
- 0001 is unchanged.
- 0002 contains the module that tests the correct behavior of 
get_actual_variable_range for non-returning ordering indices.
It contains a copy of the btree handler function with its index-only
capabilities removed. If you apply patch 0002 on master without 0001,
you will see that the test returns an error (ERROR:  no data returned
for index-only scan) as it tries to use the index in 
get_actual_variable_range, which shouldn’t be the case.

Best,
Maxime Schoemans