From: Noah Misch <noah@leadboat.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Dissociate btequalimage() from interval_ops, ending its deduplic
Date: Sat, 14 Oct 2023 23:35:41 +0000
Message-ID: <E1qroAX-000arx-1E@gemulon.postgresql.org> (raw)
Dissociate btequalimage() from interval_ops, ending its deduplication.
Under interval_ops, some equal values are distinguishable. One such
pair is '24:00:00' and '1 day'. With that being so, btequalimage()
breaches the documented contract for the "equalimage" btree support
function. This can cause incorrect results from index-only scans.
Users should REINDEX any btree indexes having interval-type columns.
After updating, pg_amcheck will report an error for almost all such
indexes. This fix makes interval_ops simply omit the support function,
like numeric_ops does. Back-pack to v13, where btequalimage() first
appeared. In back branches, for the benefit of old catalog content,
btequalimage() code will return false for type "interval". Going
forward, back-branch initdb will include the catalog change.
Reviewed by Peter Geoghegan.
Discussion: https://postgr.es/m/20231011013317.22.nmisch@google.com
Branch
------
REL_16_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/bf1c21c4fad033414a99d6205118fbc4d75efa62
Modified Files
--------------
contrib/amcheck/verify_nbtree.c | 13 ++++++++++++-
src/backend/utils/adt/datum.c | 14 ++++++--------
src/include/catalog/pg_amproc.dat | 2 --
src/include/catalog/pg_opfamily.dat | 2 +-
src/test/regress/expected/opr_sanity.out | 3 ++-
5 files changed, 21 insertions(+), 13 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 using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: noah@leadboat.com, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Dissociate btequalimage() from interval_ops, ending its deduplic
In-Reply-To: <E1qroAX-000arx-1E@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