postgresql/src
Peter Eisentraut 35e53b6841 Check that index can return in get_actual_variable_range()
Some recent changes were made to remove the explicit dependency on
btree indexes in some parts of the code.  One of these changes was
made in commit 9ef1851685, which allows non-btree indexes to be used
in get_actual_variable_range().  A follow-up commit ee1ae8b99f fixes
the cases where an index doesn’t have a sortopfamily as this is a
prerequisite to be used in get_actual_variable_range().

However, it was found that indexes that have amcanorder = true but do
not allow index-only-scans (amcanreturn returns false or is NULL) will
pass all of the conditions, while they should be rejected since
get_actual_variable_range() uses the index-only-scan machinery in
get_actual_variable_endpoint().  Such an index might cause errors like

    ERROR:  no data returned for index-only scan

during query planning.

The fix is to add a check in get_actual_variable_range() to reject
indexes that do not allow index-only scans.

Author: Maxime Schoemans <maxime.schoemans@enterprisedb.com>
Discussion: https://www.postgresql.org/message-id/flat/20ED852A-C2D9-41EB-8671-8C8B9D418BE9%40enterprisedb.com
2025-10-28 10:07:29 +01:00
..
backend Check that index can return in get_actual_variable_range() 2025-10-28 10:07:29 +01:00
bin pg_rewind: Skip copy of WAL segments generated before point of divergence 2025-10-25 09:07:31 +09:00
common Fix compiler warnings around _CRT_glob 2025-10-01 17:13:52 +02:00
fe_utils Introduce frontend API able to retrieve the contents of PG_VERSION 2025-10-14 16:20:42 +09:00
include Add wal_fpi_bytes to pg_stat_wal and pg_stat_get_backend_wal() 2025-10-28 16:21:51 +09:00
interfaces Simplify newline handling in two TAP tests 2025-10-28 08:26:42 +09:00
makefiles Remove traces of support for Sun Studio compiler 2025-09-12 07:39:05 +02:00
pl Avoid memory leak in validation of a PL/Python trigger function. 2025-10-23 14:23:26 -04:00
port Fix POSIX compliance in pgwin32_unsetenv() for "name" argument 2025-10-21 08:05:28 +09:00
template Remove traces of support for Sun Studio compiler 2025-09-12 07:39:05 +02:00
test Add wal_fpi_bytes to pg_stat_wal and pg_stat_get_backend_wal() 2025-10-28 16:21:51 +09:00
timezone Generate GUC tables from .dat file 2025-09-03 09:45:17 +02:00
tools Remove Item type 2025-10-27 09:55:59 +01:00
tutorial Fix compile of src/tutorial/funcs.c 2025-10-07 10:45:57 +02:00
.gitignore
DEVELOPERS
Makefile
Makefile.global.in Remove traces of support for Sun Studio compiler 2025-09-12 07:39:05 +02:00
Makefile.shlib Use exported symbols list on macOS for loadable modules as well 2025-06-10 07:04:43 +02:00
meson.build Update copyright for 2025 2025-01-01 11:21:55 -05:00
nls-global.mk Fix update-po for the PGXS case 2025-10-16 20:21:05 +02:00