diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2025-02-21 08:34:35 +0100 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2025-02-21 09:07:16 +0100 |
commit | 7d6d2c4bbd730bd9af191d46d4fb01d5f5c30cf1 (patch) | |
tree | 211eef7a0cd3b72f6bd182a708ff5f8191918110 /src/backend/access/index/amapi.c | |
parent | 7202d72787d3b93b692feae62ee963238580c877 (diff) | |
download | postgresql-7d6d2c4bbd730bd9af191d46d4fb01d5f5c30cf1.tar.gz postgresql-7d6d2c4bbd730bd9af191d46d4fb01d5f5c30cf1.zip |
Drop opcintype from index AM strategy translation API
The type argument wasn't actually really necessary. It was a remnant
of converting the API of the gist strategy translation from using
opclass to using opfamily+opcintype (commits c09e5a6a016,
622f678c102). For looking up the gist translation function, we used
the convention "amproclefttype = amprocrighttype = opclass's
opcintype" (see pg_amproc.h). But each operator family should only
have one translation function, and getting the right type for the
lookup is sometimes cumbersome and fragile, so this is all
unnecessarily complicated.
To simplify this, change the gist stategy support procedure to take
"any", "any" as argument. (This is arbitrary but seems intuitive.
The alternative of using InvalidOid as argument(s) upsets various DDL
commands, so it's not practical.) Then we don't need opcintype for
the lookup, and we can remove it from all the API layers introduced by
commit c09e5a6a016.
This also adds some more documentation about the correct signature of
the gist support function and adds more checks in gistvalidate().
This was previously underspecified. (It relied implicitly on
convention mentioned above.)
Discussion: https://www.postgresql.org/message-id/flat/E72EAA49-354D-4C2E-8EB9-255197F55330@enterprisedb.com
Diffstat (limited to 'src/backend/access/index/amapi.c')
-rw-r--r-- | src/backend/access/index/amapi.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/access/index/amapi.c b/src/backend/access/index/amapi.c index 5f53f49ec32..d6b8dad4d52 100644 --- a/src/backend/access/index/amapi.c +++ b/src/backend/access/index/amapi.c @@ -115,14 +115,14 @@ GetIndexAmRoutineByAmId(Oid amoid, bool noerror) * true, just return COMPARE_INVALID. */ CompareType -IndexAmTranslateStrategy(StrategyNumber strategy, Oid amoid, Oid opfamily, Oid opcintype, bool missing_ok) +IndexAmTranslateStrategy(StrategyNumber strategy, Oid amoid, Oid opfamily, bool missing_ok) { CompareType result; IndexAmRoutine *amroutine; amroutine = GetIndexAmRoutineByAmId(amoid, false); if (amroutine->amtranslatestrategy) - result = amroutine->amtranslatestrategy(strategy, opfamily, opcintype); + result = amroutine->amtranslatestrategy(strategy, opfamily); else result = COMPARE_INVALID; @@ -140,14 +140,14 @@ IndexAmTranslateStrategy(StrategyNumber strategy, Oid amoid, Oid opfamily, Oid o * to the given cmptype. If true, just return InvalidStrategy. */ StrategyNumber -IndexAmTranslateCompareType(CompareType cmptype, Oid amoid, Oid opfamily, Oid opcintype, bool missing_ok) +IndexAmTranslateCompareType(CompareType cmptype, Oid amoid, Oid opfamily, bool missing_ok) { StrategyNumber result; IndexAmRoutine *amroutine; amroutine = GetIndexAmRoutineByAmId(amoid, false); if (amroutine->amtranslatecmptype) - result = amroutine->amtranslatecmptype(cmptype, opfamily, opcintype); + result = amroutine->amtranslatecmptype(cmptype, opfamily); else result = InvalidStrategy; |