Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit a5709b5

Browse files
committed
Rename GistTranslateStratnum() to GistTranslateCompareType()
Follow up to commit 630f9a4. 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
1 parent 2452e71 commit a5709b5

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

src/backend/access/gist/gistutil.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1095,7 +1095,7 @@ gist_stratnum_common(PG_FUNCTION_ARGS)
10951095
* Returns InvalidStrategy if the function is not defined.
10961096
*/
10971097
StrategyNumber
1098-
GistTranslateStratnum(Oid opclass, CompareType cmptype)
1098+
GistTranslateCompareType(Oid opclass, CompareType cmptype)
10991099
{
11001100
Oid opfamily;
11011101
Oid opcintype;

src/backend/commands/indexcmds.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2455,7 +2455,7 @@ GetOperatorFromCompareType(Oid opclass, Oid rhstype, CompareType cmptype,
24552455
* For now we only need GiST support, but this could support other
24562456
* indexams if we wanted.
24572457
*/
2458-
*strat = GistTranslateStratnum(opclass, cmptype);
2458+
*strat = GistTranslateCompareType(opclass, cmptype);
24592459
if (*strat == InvalidStrategy)
24602460
{
24612461
HeapTuple tuple;

src/backend/commands/tablecmds.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10016,7 +10016,7 @@ ATAddForeignKeyConstraint(List **wqueue, AlteredTableInfo *tab, Relation rel,
1001610016
* ask the opclass what number it actually uses instead of our RT*
1001710017
* constants.
1001810018
*/
10019-
eqstrategy = GistTranslateStratnum(opclasses[i], cmptype);
10019+
eqstrategy = GistTranslateCompareType(opclasses[i], cmptype);
1002010020
if (eqstrategy == InvalidStrategy)
1002110021
{
1002210022
HeapTuple tuple;
@@ -10041,7 +10041,7 @@ ATAddForeignKeyConstraint(List **wqueue, AlteredTableInfo *tab, Relation rel,
1004110041
* other index AMs support unique indexes. If we ever did have
1004210042
* other types of unique indexes, we'd need a way to determine
1004310043
* which operator strategy number is equality. (We could use
10044-
* something like GistTranslateStratnum.)
10044+
* something like GistTranslateCompareType.)
1004510045
*/
1004610046
if (amid != BTREE_AM_OID)
1004710047
elog(ERROR, "only b-tree indexes are supported for foreign keys");

src/backend/executor/execReplication.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ get_equal_strategy_number(Oid opclass)
5757
ret = HTEqualStrategyNumber;
5858
break;
5959
case GIST_AM_OID:
60-
ret = GistTranslateStratnum(opclass, COMPARE_EQ);
60+
ret = GistTranslateCompareType(opclass, COMPARE_EQ);
6161
break;
6262
default:
6363
ret = InvalidStrategy;

src/include/access/gist.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,6 @@ typedef struct
248248
do { (e).key = (k); (e).rel = (r); (e).page = (pg); \
249249
(e).offset = (o); (e).leafkey = (l); } while (0)
250250

251-
extern StrategyNumber GistTranslateStratnum(Oid opclass, CompareType cmp);
251+
extern StrategyNumber GistTranslateCompareType(Oid opclass, CompareType cmptype);
252252

253253
#endif /* GIST_H */

0 commit comments

Comments
 (0)