Follow up to commit
630f9a43cec. The previous name had become
confusing, because it doesn't actually translate a strategy number but
a CompareType into a strategy number. We might add the inverse at
some point, which would then probably be called something like
GistTranslateStratnum.
Reviewed-by: Mark Dilger <mark.dilger@enterprisedb.com>
Discussion: https://www.postgresql.org/message-id/flat/
E72EAA49-354D-4C2E-8EB9-
255197F55330@enterprisedb.com
* Returns InvalidStrategy if the function is not defined.
*/
StrategyNumber
-GistTranslateStratnum(Oid opclass, CompareType cmptype)
+GistTranslateCompareType(Oid opclass, CompareType cmptype)
{
Oid opfamily;
Oid opcintype;
* For now we only need GiST support, but this could support other
* indexams if we wanted.
*/
- *strat = GistTranslateStratnum(opclass, cmptype);
+ *strat = GistTranslateCompareType(opclass, cmptype);
if (*strat == InvalidStrategy)
{
HeapTuple tuple;
* ask the opclass what number it actually uses instead of our RT*
* constants.
*/
- eqstrategy = GistTranslateStratnum(opclasses[i], cmptype);
+ eqstrategy = GistTranslateCompareType(opclasses[i], cmptype);
if (eqstrategy == InvalidStrategy)
{
HeapTuple tuple;
* other index AMs support unique indexes. If we ever did have
* other types of unique indexes, we'd need a way to determine
* which operator strategy number is equality. (We could use
- * something like GistTranslateStratnum.)
+ * something like GistTranslateCompareType.)
*/
if (amid != BTREE_AM_OID)
elog(ERROR, "only b-tree indexes are supported for foreign keys");
ret = HTEqualStrategyNumber;
break;
case GIST_AM_OID:
- ret = GistTranslateStratnum(opclass, COMPARE_EQ);
+ ret = GistTranslateCompareType(opclass, COMPARE_EQ);
break;
default:
ret = InvalidStrategy;
do { (e).key = (k); (e).rel = (r); (e).page = (pg); \
(e).offset = (o); (e).leafkey = (l); } while (0)
-extern StrategyNumber GistTranslateStratnum(Oid opclass, CompareType cmp);
+extern StrategyNumber GistTranslateCompareType(Oid opclass, CompareType cmptype);
#endif /* GIST_H */