From: Peter Geoghegan <pg@bowt.ie>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix nbtree unsatisfiable row compare assertion failure.
Date: Sat, 17 Oct 2026 15:04:20 +0000
Message-ID: <E1xI5xM-000000021U7-39cb@gemulon.postgresql.org> (raw)
Fix nbtree unsatisfiable row compare assertion failure.
An assertion within nbtree preprocessing's _bt_mark_scankey_required
function expects the first member key of a row compare to have the same
strategy as its header key, which its caller passes. But the first row
member key won't necessarily have been commuted in cases where the row
compare is unsatisfiable due to its first member key having a NULL
argument. This led to spurious assertion failures in the single key
fast path call to _bt_mark_scankey_required.
To fix, always commute the row members, even when the row compare is
unsatisfiable. That way the header and its members will always agree on
strategy.
Oversight in commit ec986020, which improved nbtree's unsatisfiable
RowCompare detection.
Author: Peter Geoghegan <pg@bowt.ie>
Backpatch-through: 18
Branch
------
REL_18_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/4732a5c53bd858ed057d52286fb6105385baa2a6
Modified Files
--------------
src/backend/access/nbtree/nbtpreprocesskeys.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: pg@bowt.ie
Subject: Re: pgsql: Fix nbtree unsatisfiable row compare assertion failure.
In-Reply-To: <E1xI5xM-000000021U7-39cb@gemulon.postgresql.org>
References: <E1xI5xM-000000021U7-39cb@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox