postgresql/src/backend
Peter Geoghegan bee763aea1 nbtree: Always set skipScan flag on rescan.
The TimescaleDB extension expects to be able to change an nbtree scan's
keys across rescans.  The issue arises in the extension's implementation
of loose index scan.  This is arguably a misuse of the index AM API,
though apparently it worked until recently.  It stopped working when the
skipScan flag was added to BTScanOpaqueData by commit 8a510275, though.
The flag wouldn't reliably track whether the scan (actually, the current
rescan) has any skip arrays, leading to confusion in _bt_set_startikey.

nbtree preprocessing will now defensively initialize the scan's skipScan
flag in all cases, including the case where _bt_preprocess_array_keys
returns early due to the (re)scan not using arrays.  While nbtree isn't
obligated to support this use case (at least not according to my reading
of the index AM API), it still seems like a good idea to be consistent
here, on general robustness grounds.

Author: Peter Geoghegan <pg@bowt.ie>
Reported-By: Natalya Aksman <natalya@timescale.com>
Discussion: https://postgr.es/m/CAJumhcirfMojbk20+W0YimbNDkwdECvJprQGQ-XqK--ph09nQw@mail.gmail.com
Backpatch-through: 18
2025-09-13 21:01:31 -04:00
..
access nbtree: Always set skipScan flag on rescan. 2025-09-13 21:01:31 -04:00
archive Update copyright for 2025 2025-01-01 11:21:55 -05:00
backup Use XLOG_CONTROL_FILE macro consistently for control file name. 2025-04-07 09:27:33 +09:00
bootstrap Remove unnecessary (char *) casts [mem] 2025-02-12 08:50:13 +01:00
catalog Improve objectNamesToOids() comment 2025-08-27 17:33:54 +02:00
commands Fix oversights in pg_event_trigger_dropped_objects() fixes. 2025-09-12 17:43:18 -04:00
executor Fix memory leakage in nodeSubplan.c. 2025-09-10 16:05:03 -04:00
foreign Track the number of presorted outer pathkeys in MergePath 2025-05-08 18:21:32 +09:00
jit Don't put library-supplied -L/-I switches before user-supplied ones. 2025-07-29 15:17:40 -04:00
lib Correct list of files in src/backend/lib/README 2025-06-27 09:31:23 +09:00
libpq Fix build breakage on Solaris-alikes with late-model GCC. 2025-07-23 15:44:29 -04:00
main Use thread-safe strftime_l() instead of strftime(). 2025-03-28 07:13:43 +01:00
nodes Adapt REL_18_STABLE to its new status as a stable branch 2025-06-29 23:00:00 -04:00
optimizer Fix planner error when estimating SubPlan cost 2025-09-03 16:03:43 +09:00
parser Fix CREATE TABLE LIKE with not-valid check constraint 2025-09-10 13:25:34 +02:00
partitioning Fix bug in cbc127917 to handle nested Append correctly 2025-02-25 09:24:42 +09:00
po Translation updates 2025-09-01 13:07:49 +02:00
port Don't treat EINVAL from semget() as a hard failure. 2025-08-13 11:59:47 -04:00
postmaster Use LW_SHARED in walsummarizer.c for WALSummarizerLock lock where possible. 2025-08-28 17:06:44 -07:00
regex Another unintentional behavior change in commit e9931bfb75. 2025-04-16 16:49:42 -07:00
replication Remove stray semicolon at global scope 2025-09-11 12:03:30 +02:00
rewrite Change internal queryid type from uint64 to int64 2025-05-30 22:59:39 +12:00
snowball Use PG_MODULE_MAGIC_EXT in our installable shared libraries. 2025-03-26 11:11:02 -04:00
statistics Message style improvements 2025-08-28 09:09:05 +02:00
storage meson: build checksums with extra optimization flags. 2025-09-09 16:04:04 -07:00
tcop CREATE STATISTICS: improve misleading error message 2025-08-29 14:43:47 +02:00
tsearch Clear errno before calling strtol() in spell.c. 2025-03-08 11:24:25 -05:00
utils Amend recent fix for SIMILAR TO regex conversion. 2025-09-13 16:55:51 -04:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Blind attempt to fix LLVM dependency in the backend 2022-09-15 10:53:48 +07:00
Makefile aio: Add liburing dependency 2025-03-26 19:45:32 -04:00
meson.build Update copyright for 2025 2025-01-01 11:21:55 -05:00
nls.mk Return yyparse() result not via global variable 2025-01-24 06:55:39 +01:00