From: | Noah Misch <noah(at)leadboat(dot)com> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: Dissociate btequalimage() from interval_ops, ending its deduplic |
Date: | 2023-10-14 23:35:41 |
Message-ID: | E1qroAX-000as4-2V@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
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_13_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/6fd1dbdb21cb02ea2d307cc8fd931e6a218bfa64
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(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2023-10-14 23:45:21 | Re: pgsql: Dissociate btequalimage() from interval_ops, ending its deduplic |
Previous Message | Noah Misch | 2023-10-14 22:55:52 | pgsql: Don't spuriously report FD_SETSIZE exhaustion on Windows. |