Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita5709b5

Browse files
committed
Rename GistTranslateStratnum() to GistTranslateCompareType()
Follow up to commit630f9a4. The previous name had becomeconfusing, because it doesn't actually translate a strategy number buta CompareType into a strategy number. We might add the inverse atsome point, which would then probably be called something likeGistTranslateStratnum.Reviewed-by: Mark Dilger <mark.dilger@enterprisedb.com>Discussion:https://www.postgresql.org/message-id/flat/E72EAA49-354D-4C2E-8EB9-255197F55330@enterprisedb.com
1 parent2452e71 commita5709b5

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(Oidopclass,CompareTypecmptype)
1098+
GistTranslateCompareType(Oidopclass,CompareTypecmptype)
10991099
{
11001100
Oidopfamily;
11011101
Oidopcintype;

‎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
HeapTupletuple;

‎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
HeapTupletuple;
@@ -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 likeGistTranslateStratnum.)
10044+
* something likeGistTranslateCompareType.)
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
caseGIST_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-
externStrategyNumberGistTranslateStratnum(Oidopclass,CompareTypecmp);
251+
externStrategyNumberGistTranslateCompareType(Oidopclass,CompareTypecmptype);
252252

253253
#endif/* GIST_H */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp