On 17.09.24 11:45, Peter Eisentraut wrote:
On 05.09.24 14:09, Peter Eisentraut wrote:
On 07.08.24 22:54, Paul Jungwirth wrote:
Here are some fixes based on outstanding feedback (some old some new).
I have studied your patches v39-0001 through v39-0004, which
correspond to what had been reverted plus the new empty range check
plus various minor fixes. This looks good to me now, so I propose to
go ahead with that.
Btw., in your 0003 you point out that this prevents using the WITHOUT
OVERLAPS functionality for non-range types. But I think this could be
accomplished by adding an "is empty" callback as a support function or
something like that. I'm not suggesting to do that here, but it might
be worth leaving a comment about that possibility.
I have committed these, as explained here.
Here we added a gist support function that we internally refer to by the
symbol GIST_STRATNUM_PROC. This translated from "well-known" strategy
numbers to opfamily-specific strategy numbers. However, we later
changed this to fit into index-AM-level compare type mapping, so this
function actually now maps from compare type to opfamily-specific
strategy numbers. So I'm wondering if this name is still good.
Moreover, the index AM level also supports the opposite, a function to
map from strategy number to compare type. This is currently not
supported in gist, but one might wonder what this function is supposed
to be called when it is added.
So I went through and updated the naming of the gist-level functionality
to be more in line with the index-AM-level functionality; see attached
patch. I think this makes sense because these are essentially the same
thing on different levels. What do you think? (This would be for PG18.)
From 5cada8bb5032e7b2ee6e218dc38bc6ff35096a23 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <pe...@eisentraut.org>
Date: Mon, 26 May 2025 07:48:51 +0200
Subject: [PATCH] WIP: Rename gist stratnum support function
---
contrib/btree_gist/btree_gist--1.7--1.8.sql | 54 ++++++++++----------
contrib/btree_gist/btree_gist.c | 4 +-
contrib/btree_gist/expected/stratnum.out | 18 +++----
contrib/btree_gist/sql/stratnum.sql | 6 +--
doc/src/sgml/gist.sgml | 25 ++++++---
doc/src/sgml/xindex.sgml | 2 +-
src/backend/access/gist/gistutil.c | 14 ++---
src/backend/access/gist/gistvalidate.c | 6 +--
src/include/access/gist.h | 2 +-
src/include/catalog/pg_amproc.dat | 12 ++---
src/include/catalog/pg_proc.dat | 4 +-
src/test/regress/expected/misc_functions.out | 18 +++----
src/test/regress/sql/misc_functions.sql | 6 +--
13 files changed, 91 insertions(+), 80 deletions(-)
diff --git a/contrib/btree_gist/btree_gist--1.7--1.8.sql
b/contrib/btree_gist/btree_gist--1.7--1.8.sql
index 4ff9c43a8eb..8f79365a461 100644
--- a/contrib/btree_gist/btree_gist--1.7--1.8.sql
+++ b/contrib/btree_gist/btree_gist--1.7--1.8.sql
@@ -3,85 +3,85 @@
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "ALTER EXTENSION btree_gist UPDATE TO '1.8'" to load this file. \quit
-CREATE FUNCTION gist_stratnum_btree(int)
+CREATE FUNCTION gist_translate_cmptype_btree(int)
RETURNS smallint
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE PARALLEL SAFE STRICT;
ALTER OPERATOR FAMILY gist_oid_ops USING gist ADD
- FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
+ FUNCTION 12 ("any", "any") gist_translate_cmptype_btree (int) ;
ALTER OPERATOR FAMILY gist_int2_ops USING gist ADD
- FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
+ FUNCTION 12 ("any", "any") gist_translate_cmptype_btree (int) ;
ALTER OPERATOR FAMILY gist_int4_ops USING gist ADD
- FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
+ FUNCTION 12 ("any", "any") gist_translate_cmptype_btree (int) ;
ALTER OPERATOR FAMILY gist_int8_ops USING gist ADD
- FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
+ FUNCTION 12 ("any", "any") gist_translate_cmptype_btree (int) ;
ALTER OPERATOR FAMILY gist_float4_ops USING gist ADD
- FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
+ FUNCTION 12 ("any", "any") gist_translate_cmptype_btree (int) ;
ALTER OPERATOR FAMILY gist_float8_ops USING gist ADD
- FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
+ FUNCTION 12 ("any", "any") gist_translate_cmptype_btree (int) ;
ALTER OPERATOR FAMILY gist_timestamp_ops USING gist ADD
- FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
+ FUNCTION 12 ("any", "any") gist_translate_cmptype_btree (int) ;
ALTER OPERATOR FAMILY gist_timestamptz_ops USING gist ADD
- FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
+ FUNCTION 12 ("any", "any") gist_translate_cmptype_btree (int) ;
ALTER OPERATOR FAMILY gist_time_ops USING gist ADD
- FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
+ FUNCTION 12 ("any", "any") gist_translate_cmptype_btree (int) ;
ALTER OPERATOR FAMILY gist_date_ops USING gist ADD
- FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
+ FUNCTION 12 ("any", "any") gist_translate_cmptype_btree (int) ;
ALTER OPERATOR FAMILY gist_interval_ops USING gist ADD
- FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
+ FUNCTION 12 ("any", "any") gist_translate_cmptype_btree (int) ;
ALTER OPERATOR FAMILY gist_cash_ops USING gist ADD
- FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
+ FUNCTION 12 ("any", "any") gist_translate_cmptype_btree (int) ;
ALTER OPERATOR FAMILY gist_macaddr_ops USING gist ADD
- FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
+ FUNCTION 12 ("any", "any") gist_translate_cmptype_btree (int) ;
ALTER OPERATOR FAMILY gist_text_ops USING gist ADD
- FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
+ FUNCTION 12 ("any", "any") gist_translate_cmptype_btree (int) ;
ALTER OPERATOR FAMILY gist_bpchar_ops USING gist ADD
- FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
+ FUNCTION 12 ("any", "any") gist_translate_cmptype_btree (int) ;
ALTER OPERATOR FAMILY gist_bytea_ops USING gist ADD
- FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
+ FUNCTION 12 ("any", "any") gist_translate_cmptype_btree (int) ;
ALTER OPERATOR FAMILY gist_numeric_ops USING gist ADD
- FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
+ FUNCTION 12 ("any", "any") gist_translate_cmptype_btree (int) ;
ALTER OPERATOR FAMILY gist_bit_ops USING gist ADD
- FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
+ FUNCTION 12 ("any", "any") gist_translate_cmptype_btree (int) ;
ALTER OPERATOR FAMILY gist_vbit_ops USING gist ADD
- FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
+ FUNCTION 12 ("any", "any") gist_translate_cmptype_btree (int) ;
ALTER OPERATOR FAMILY gist_inet_ops USING gist ADD
- FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
+ FUNCTION 12 ("any", "any") gist_translate_cmptype_btree (int) ;
ALTER OPERATOR FAMILY gist_cidr_ops USING gist ADD
- FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
+ FUNCTION 12 ("any", "any") gist_translate_cmptype_btree (int) ;
ALTER OPERATOR FAMILY gist_timetz_ops USING gist ADD
- FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
+ FUNCTION 12 ("any", "any") gist_translate_cmptype_btree (int) ;
ALTER OPERATOR FAMILY gist_uuid_ops USING gist ADD
- FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
+ FUNCTION 12 ("any", "any") gist_translate_cmptype_btree (int) ;
ALTER OPERATOR FAMILY gist_macaddr8_ops USING gist ADD
- FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
+ FUNCTION 12 ("any", "any") gist_translate_cmptype_btree (int) ;
ALTER OPERATOR FAMILY gist_enum_ops USING gist ADD
- FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
+ FUNCTION 12 ("any", "any") gist_translate_cmptype_btree (int) ;
ALTER OPERATOR FAMILY gist_bool_ops USING gist ADD
- FUNCTION 12 ("any", "any") gist_stratnum_btree (int) ;
+ FUNCTION 12 ("any", "any") gist_translate_cmptype_btree (int) ;
diff --git a/contrib/btree_gist/btree_gist.c b/contrib/btree_gist/btree_gist.c
index 280ce808456..39fcbdad334 100644
--- a/contrib/btree_gist/btree_gist.c
+++ b/contrib/btree_gist/btree_gist.c
@@ -15,7 +15,7 @@ PG_MODULE_MAGIC_EXT(
PG_FUNCTION_INFO_V1(gbt_decompress);
PG_FUNCTION_INFO_V1(gbtreekey_in);
PG_FUNCTION_INFO_V1(gbtreekey_out);
-PG_FUNCTION_INFO_V1(gist_stratnum_btree);
+PG_FUNCTION_INFO_V1(gist_translate_cmptype_btree);
/**************************************************
* In/Out for keys
@@ -62,7 +62,7 @@ gbt_decompress(PG_FUNCTION_ARGS)
* Returns the btree number for supported operators, otherwise invalid.
*/
Datum
-gist_stratnum_btree(PG_FUNCTION_ARGS)
+gist_translate_cmptype_btree(PG_FUNCTION_ARGS)
{
CompareType cmptype = PG_GETARG_INT32(0);
diff --git a/contrib/btree_gist/expected/stratnum.out
b/contrib/btree_gist/expected/stratnum.out
index dd0edaf4a20..8222b661538 100644
--- a/contrib/btree_gist/expected/stratnum.out
+++ b/contrib/btree_gist/expected/stratnum.out
@@ -1,13 +1,13 @@
--- test stratnum support func
-SELECT gist_stratnum_btree(7);
- gist_stratnum_btree
----------------------
- 0
+-- test stratnum translation support func
+SELECT gist_translate_cmptype_btree(7);
+ gist_translate_cmptype_btree
+------------------------------
+ 0
(1 row)
-SELECT gist_stratnum_btree(3);
- gist_stratnum_btree
----------------------
- 3
+SELECT gist_translate_cmptype_btree(3);
+ gist_translate_cmptype_btree
+------------------------------
+ 3
(1 row)
diff --git a/contrib/btree_gist/sql/stratnum.sql
b/contrib/btree_gist/sql/stratnum.sql
index 75adddad849..da8bbf883b0 100644
--- a/contrib/btree_gist/sql/stratnum.sql
+++ b/contrib/btree_gist/sql/stratnum.sql
@@ -1,3 +1,3 @@
--- test stratnum support func
-SELECT gist_stratnum_btree(7);
-SELECT gist_stratnum_btree(3);
+-- test stratnum translation support func
+SELECT gist_translate_cmptype_btree(7);
+SELECT gist_translate_cmptype_btree(3);
diff --git a/doc/src/sgml/gist.sgml b/doc/src/sgml/gist.sgml
index a373a8aa4b2..ee86e170055 100644
--- a/doc/src/sgml/gist.sgml
+++ b/doc/src/sgml/gist.sgml
@@ -1170,7 +1170,7 @@ <title>Extensibility</title>
</varlistentry>
<varlistentry>
- <term><function>stratnum</function></term>
+ <term><function>translate_cmptype</function></term>
<listitem>
<para>
Given a <literal>CompareType</literal> value from
@@ -1188,12 +1188,23 @@ <title>Extensibility</title>
non-<literal>WITHOUT OVERLAPS</literal> part(s) of an index constraint.
</para>
+ <para>
+ This support function corresponds to the index access method callback
+ function <structfield>amtranslatecmptype</structfield> (see <xref
+ linkend="index-functions"/>). The
+ <structfield>amtranslatecmptype</structfield> callback function for
+ GiST indexes merely calls down to the
+ <function>translate_cmptype</function> support function of the
+ respective operator family, since the GiST index access method has no
+ fixed strategy numbers itself.
+ </para>
+
<para>
The <acronym>SQL</acronym> declaration of the function must look like
this:
<programlisting>
-CREATE OR REPLACE FUNCTION my_stratnum(integer)
+CREATE OR REPLACE FUNCTION my_translate_cmptype(integer)
RETURNS smallint
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT;
@@ -1202,7 +1213,7 @@ <title>Extensibility</title>
And the operator family registration must look like this:
<programlisting>
ALTER OPERATOR FAMILY my_opfamily USING gist ADD
- FUNCTION 12 ("any", "any") my_stratnum(int);
+ FUNCTION 12 ("any", "any") my_translate_cmptype(int);
</programlisting>
</para>
@@ -1210,10 +1221,10 @@ <title>Extensibility</title>
The matching code in the C module could then follow this skeleton:
<programlisting>
-PG_FUNCTION_INFO_V1(my_stratnum);
+PG_FUNCTION_INFO_V1(my_translate_cmptype);
Datum
-my_stratnum(PG_FUNCTION_ARGS)
+my_translate_cmptype(PG_FUNCTION_ARGS)
{
CompareType cmptype = PG_GETARG_INT32(0);
StrategyNumber ret = InvalidStrategy;
@@ -1232,11 +1243,11 @@ <title>Extensibility</title>
<para>
One translation function is provided by
<productname>PostgreSQL</productname>:
- <literal>gist_stratnum_common</literal> is for operator classes that
+ <literal>gist_translate_cmptype_common</literal> is for operator
classes that
use the <literal>RT*StrategyNumber</literal> constants.
The <literal>btree_gist</literal>
extension defines a second translation function,
- <literal>gist_stratnum_btree</literal>, for operator classes that use
+ <literal>gist_translate_cmptype_btree</literal>, for operator classes
that use
the <literal>BT*StrategyNumber</literal> constants.
</para>
</listitem>
diff --git a/doc/src/sgml/xindex.sgml b/doc/src/sgml/xindex.sgml
index 7e23a7b6e43..3d315df2f98 100644
--- a/doc/src/sgml/xindex.sgml
+++ b/doc/src/sgml/xindex.sgml
@@ -598,7 +598,7 @@ <title>GiST Support Functions</title>
<entry>11</entry>
</row>
<row>
- <entry><function>stratnum</function></entry>
+ <entry><function>translate_cmptype</function></entry>
<entry>translate compare types to strategy numbers
used by the operator class (optional)</entry>
<entry>12</entry>
diff --git a/src/backend/access/gist/gistutil.c
b/src/backend/access/gist/gistutil.c
index a6b701943d3..c0aa7d0222f 100644
--- a/src/backend/access/gist/gistutil.c
+++ b/src/backend/access/gist/gistutil.c
@@ -1058,11 +1058,11 @@ gistGetFakeLSN(Relation rel)
}
/*
- * This is a stratnum support function for GiST opclasses that use the
- * RT*StrategyNumber constants.
+ * This is a stratnum translation support function for GiST opclasses that use
+ * the RT*StrategyNumber constants.
*/
Datum
-gist_stratnum_common(PG_FUNCTION_ARGS)
+gist_translate_cmptype_common(PG_FUNCTION_ARGS)
{
CompareType cmptype = PG_GETARG_INT32(0);
@@ -1090,9 +1090,9 @@ gist_stratnum_common(PG_FUNCTION_ARGS)
/*
* Returns the opclass's private stratnum used for the given compare type.
*
- * Calls the opclass's GIST_STRATNUM_PROC support function, if any,
- * and returns the result.
- * Returns InvalidStrategy if the function is not defined.
+ * Calls the opclass's GIST_TRANSLATE_CMPTYPE_PROC support function, if any,
+ * and returns the result. Returns InvalidStrategy if the function is not
+ * defined.
*/
StrategyNumber
gisttranslatecmptype(CompareType cmptype, Oid opfamily)
@@ -1101,7 +1101,7 @@ gisttranslatecmptype(CompareType cmptype, Oid opfamily)
Datum result;
/* Check whether the function is provided. */
- funcid = get_opfamily_proc(opfamily, ANYOID, ANYOID,
GIST_STRATNUM_PROC);
+ funcid = get_opfamily_proc(opfamily, ANYOID, ANYOID,
GIST_TRANSLATE_CMPTYPE_PROC);
if (!OidIsValid(funcid))
return InvalidStrategy;
diff --git a/src/backend/access/gist/gistvalidate.c
b/src/backend/access/gist/gistvalidate.c
index 2a49e6d20f0..2ed6f74fce9 100644
--- a/src/backend/access/gist/gistvalidate.c
+++ b/src/backend/access/gist/gistvalidate.c
@@ -138,7 +138,7 @@ gistvalidate(Oid opclassoid)
ok = check_amproc_signature(procform->amproc,
VOIDOID, true,
1, 1, INTERNALOID);
break;
- case GIST_STRATNUM_PROC:
+ case GIST_TRANSLATE_CMPTYPE_PROC:
ok = check_amproc_signature(procform->amproc,
INT2OID, true,
1, 1, INT4OID) &&
procform->amproclefttype == ANYOID &&
@@ -265,7 +265,7 @@ gistvalidate(Oid opclassoid)
if (i == GIST_DISTANCE_PROC || i == GIST_FETCH_PROC ||
i == GIST_COMPRESS_PROC || i == GIST_DECOMPRESS_PROC ||
i == GIST_OPTIONS_PROC || i == GIST_SORTSUPPORT_PROC ||
- i == GIST_STRATNUM_PROC)
+ i == GIST_TRANSLATE_CMPTYPE_PROC)
continue; /* optional methods */
ereport(INFO,
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
@@ -336,7 +336,7 @@ gistadjustmembers(Oid opfamilyoid,
case GIST_FETCH_PROC:
case GIST_OPTIONS_PROC:
case GIST_SORTSUPPORT_PROC:
- case GIST_STRATNUM_PROC:
+ case GIST_TRANSLATE_CMPTYPE_PROC:
/* Optional, so force it to be a soft family
dependency */
op->ref_is_hard = false;
op->ref_is_family = true;
diff --git a/src/include/access/gist.h b/src/include/access/gist.h
index db78e60eeab..b3f4e02cbfd 100644
--- a/src/include/access/gist.h
+++ b/src/include/access/gist.h
@@ -40,7 +40,7 @@
#define GIST_FETCH_PROC 9
#define GIST_OPTIONS_PROC 10
#define GIST_SORTSUPPORT_PROC 11
-#define GIST_STRATNUM_PROC 12
+#define GIST_TRANSLATE_CMPTYPE_PROC 12
#define GISTNProcs 12
/*
diff --git a/src/include/catalog/pg_amproc.dat
b/src/include/catalog/pg_amproc.dat
index 92505148998..e3477500baa 100644
--- a/src/include/catalog/pg_amproc.dat
+++ b/src/include/catalog/pg_amproc.dat
@@ -533,7 +533,7 @@
amprocrighttype => 'box', amprocnum => '8', amproc => 'gist_box_distance' },
{ amprocfamily => 'gist/box_ops', amproclefttype => 'any',
amprocrighttype => 'any', amprocnum => '12',
- amproc => 'gist_stratnum_common' },
+ amproc => 'gist_translate_cmptype_common' },
{ amprocfamily => 'gist/poly_ops', amproclefttype => 'polygon',
amprocrighttype => 'polygon', amprocnum => '1',
amproc => 'gist_poly_consistent' },
@@ -555,7 +555,7 @@
amproc => 'gist_poly_distance' },
{ amprocfamily => 'gist/poly_ops', amproclefttype => 'any',
amprocrighttype => 'any', amprocnum => '12',
- amproc => 'gist_stratnum_common' },
+ amproc => 'gist_translate_cmptype_common' },
{ amprocfamily => 'gist/circle_ops', amproclefttype => 'circle',
amprocrighttype => 'circle', amprocnum => '1',
amproc => 'gist_circle_consistent' },
@@ -576,7 +576,7 @@
amproc => 'gist_circle_distance' },
{ amprocfamily => 'gist/circle_ops', amproclefttype => 'any',
amprocrighttype => 'any', amprocnum => '12',
- amproc => 'gist_stratnum_common' },
+ amproc => 'gist_translate_cmptype_common' },
{ amprocfamily => 'gist/tsvector_ops', amproclefttype => 'tsvector',
amprocrighttype => 'tsvector', amprocnum => '1',
amproc => 'gtsvector_consistent(internal,tsvector,int2,oid,internal)' },
@@ -636,7 +636,7 @@
amproc => 'range_sortsupport' },
{ amprocfamily => 'gist/range_ops', amproclefttype => 'any',
amprocrighttype => 'any', amprocnum => '12',
- amproc => 'gist_stratnum_common' },
+ amproc => 'gist_translate_cmptype_common' },
{ amprocfamily => 'gist/network_ops', amproclefttype => 'inet',
amprocrighttype => 'inet', amprocnum => '1',
amproc => 'inet_gist_consistent' },
@@ -655,7 +655,7 @@
amprocrighttype => 'inet', amprocnum => '9', amproc => 'inet_gist_fetch' },
{ amprocfamily => 'gist/network_ops', amproclefttype => 'any',
amprocrighttype => 'any', amprocnum => '12',
- amproc => 'gist_stratnum_common' },
+ amproc => 'gist_translate_cmptype_common' },
{ amprocfamily => 'gist/multirange_ops', amproclefttype => 'anymultirange',
amprocrighttype => 'anymultirange', amprocnum => '1',
amproc => 'multirange_gist_consistent' },
@@ -676,7 +676,7 @@
amproc => 'range_gist_same' },
{ amprocfamily => 'gist/multirange_ops', amproclefttype => 'any',
amprocrighttype => 'any', amprocnum => '12',
- amproc => 'gist_stratnum_common' },
+ amproc => 'gist_translate_cmptype_common' },
# gin
{ amprocfamily => 'gin/array_ops', amproclefttype => 'anyarray',
diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat
index 37a484147a8..d3d28a263fa 100644
--- a/src/include/catalog/pg_proc.dat
+++ b/src/include/catalog/pg_proc.dat
@@ -12543,9 +12543,9 @@
# GiST stratnum implementations
{ oid => '8047', descr => 'GiST support',
- proname => 'gist_stratnum_common', prorettype => 'int2',
+ proname => 'gist_translate_cmptype_common', prorettype => 'int2',
proargtypes => 'int4',
- prosrc => 'gist_stratnum_common' },
+ prosrc => 'gist_translate_cmptype_common' },
# AIO related functions
{ oid => '9200', descr => 'information about in-progress asynchronous IOs',
diff --git a/src/test/regress/expected/misc_functions.out
b/src/test/regress/expected/misc_functions.out
index cc517ed5e90..c3b2b9d8603 100644
--- a/src/test/regress/expected/misc_functions.out
+++ b/src/test/regress/expected/misc_functions.out
@@ -890,17 +890,17 @@ SELECT pg_column_toast_chunk_id(a) IS NULL,
DROP TABLE test_chunk_id;
DROP FUNCTION explain_mask_costs(text, bool, bool, bool, bool);
--- test stratnum support functions
-SELECT gist_stratnum_common(7);
- gist_stratnum_common
-----------------------
- 3
+-- test stratnum translation support functions
+SELECT gist_translate_cmptype_common(7);
+ gist_translate_cmptype_common
+-------------------------------
+ 3
(1 row)
-SELECT gist_stratnum_common(3);
- gist_stratnum_common
-----------------------
- 18
+SELECT gist_translate_cmptype_common(3);
+ gist_translate_cmptype_common
+-------------------------------
+ 18
(1 row)
-- relpath tests
diff --git a/src/test/regress/sql/misc_functions.sql
b/src/test/regress/sql/misc_functions.sql
index 5f9c77512d1..23792c4132a 100644
--- a/src/test/regress/sql/misc_functions.sql
+++ b/src/test/regress/sql/misc_functions.sql
@@ -400,9 +400,9 @@ CREATE TABLE test_chunk_id (a TEXT, b TEXT STORAGE
EXTERNAL);
DROP TABLE test_chunk_id;
DROP FUNCTION explain_mask_costs(text, bool, bool, bool, bool);
--- test stratnum support functions
-SELECT gist_stratnum_common(7);
-SELECT gist_stratnum_common(3);
+-- test stratnum translation support functions
+SELECT gist_translate_cmptype_common(7);
+SELECT gist_translate_cmptype_common(3);
-- relpath tests
--
2.49.0