From: Peter Geoghegan Date: Thu, 1 May 2025 03:15:51 +0000 (-0400) Subject: Adjust overstrong nbtree skip array assertion. X-Git-Tag: REL_18_BETA1~37 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=9d924dbb37103b647c72a5252ad20770b8bae3a1;p=postgresql.git Adjust overstrong nbtree skip array assertion. Make an nbtree array preprocessing assertion account for scans that add fewer skip arrays than initially expected due to preprocessing finding an unsatisfiable array qual. Oversight in commit 92fe23d9. Author: Peter Geoghegan Reported-By: Mark Dilger Discussion: https://postgr.es/m/CAHgHdKtQMhHy5qcB3KqCcGiW-Rp8P7KzUFRa9ZMKUiv6zen7LQ@mail.gmail.com --- diff --git a/src/backend/access/nbtree/nbtpreprocesskeys.c b/src/backend/access/nbtree/nbtpreprocesskeys.c index 1cc99e6cdf2..a136e4bbfdf 100644 --- a/src/backend/access/nbtree/nbtpreprocesskeys.c +++ b/src/backend/access/nbtree/nbtpreprocesskeys.c @@ -1856,7 +1856,7 @@ _bt_preprocess_array_keys(IndexScanDesc scan, int *new_numberOfKeys) numArrayKeyData++; /* keep this scan key/array */ } - Assert(numSkipArrayKeys == 0); + Assert(numSkipArrayKeys == 0 || !so->qual_ok); /* Set final number of equality-type array keys */ so->numArrayKeys = numArrayKeys;