diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2025-02-27 17:03:31 +0100 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2025-02-27 17:03:31 +0100 |
commit | ce62f2f2a0a48d021f250ba84dfcab5d45ddc914 (patch) | |
tree | dd73a4a521f961961ce8c991363b3425e9e4741d /src/backend/executor | |
parent | 6eb8a1a4f90c542d7ce9dcc381528fcb81390ab9 (diff) |
Generalize hash and ordering support in amapi
Stop comparing access method OID values against HASH_AM_OID and
BTREE_AM_OID, and instead check the IndexAmRoutine for an index to see
if it advertises its ability to perform the necessary ordering,
hashing, or cross-type comparing functionality. A field amcanorder
already existed, this uses it more widely. Fields amcanhash and
amcancrosscompare are added for the other purposes.
Author: Mark Dilger <mark.dilger@enterprisedb.com>
Discussion: https://www.postgresql.org/message-id/flat/E72EAA49-354D-4C2E-8EB9-255197F55330@enterprisedb.com
Diffstat (limited to 'src/backend/executor')
-rw-r--r-- | src/backend/executor/nodeIndexscan.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/executor/nodeIndexscan.c b/src/backend/executor/nodeIndexscan.c index 3b2275e8fe9..c30b9c2c197 100644 --- a/src/backend/executor/nodeIndexscan.c +++ b/src/backend/executor/nodeIndexscan.c @@ -1331,10 +1331,10 @@ ExecIndexBuildScanKeys(PlanState *planstate, Relation index, varattno = ((Var *) leftop)->varattno; /* - * We have to look up the operator's associated btree support + * We have to look up the operator's associated support * function */ - if (index->rd_rel->relam != BTREE_AM_OID || + if (!index->rd_indam->amcanorder || varattno < 1 || varattno > indnkeyatts) elog(ERROR, "bogus RowCompare index qualification"); opfamily = index->rd_opfamily[varattno - 1]; |