From b70eb4fcff3819a3671f21164319750a5a174083 Mon Sep 17 00:00:00 2001
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
Date: Mon, 23 Mar 2020 18:58:14 -0300
Subject: [PATCH 5/5] rename get_range_multirange_subtype to
 get_multirange_range

---
 src/backend/parser/parse_coerce.c   | 4 ++--
 src/backend/utils/cache/lsyscache.c | 8 ++++----
 src/backend/utils/cache/typcache.c  | 2 +-
 src/backend/utils/fmgr/funcapi.c    | 4 ++--
 src/include/utils/lsyscache.h       | 2 +-
 5 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/backend/parser/parse_coerce.c b/src/backend/parser/parse_coerce.c
index fb8c3e5cb0..91f80a0656 100644
--- a/src/backend/parser/parse_coerce.c
+++ b/src/backend/parser/parse_coerce.c
@@ -1757,7 +1757,7 @@ check_generic_type_consistency(const Oid *actual_arg_types,
 	{
 		Oid			multirange_typelem;
 
-		multirange_typelem = get_range_multirange_subtype(multirange_typeid);
+		multirange_typelem = get_multirange_range(multirange_typeid);
 		if (!OidIsValid(multirange_typelem))
 			return false;		/* should be a multirange, but isn't */
 
@@ -2222,7 +2222,7 @@ enforce_generic_type_consistency(const Oid *actual_arg_types,
 		/* Get the element type based on the multirange type, if we have one */
 		if (OidIsValid(multirange_typeid))
 		{
-			multirange_typelem = get_range_multirange_subtype(multirange_typeid);
+			multirange_typelem = get_multirange_range(multirange_typeid);
 			if (!OidIsValid(multirange_typelem))
 				ereport(ERROR,
 						(errcode(ERRCODE_DATATYPE_MISMATCH),
diff --git a/src/backend/utils/cache/lsyscache.c b/src/backend/utils/cache/lsyscache.c
index c6c079c623..8d773d40c4 100644
--- a/src/backend/utils/cache/lsyscache.c
+++ b/src/backend/utils/cache/lsyscache.c
@@ -3238,13 +3238,13 @@ get_range_multirange(Oid rangeOid)
 }
 
 /*
- * get_range_multirange_subtype
- *		Returns the subtype of a given multirange type
+ * get_multirange_range
+ *		Returns the range type of a given multirange
  *
- * Returns InvalidOid if the type is not a multirange type.
+ * Returns InvalidOid if the type is not a multirange.
  */
 Oid
-get_range_multirange_subtype(Oid multirangeOid)
+get_multirange_range(Oid multirangeOid)
 {
 	HeapTuple	tp;
 
diff --git a/src/backend/utils/cache/typcache.c b/src/backend/utils/cache/typcache.c
index 160846cf10..f1d3cb97d0 100644
--- a/src/backend/utils/cache/typcache.c
+++ b/src/backend/utils/cache/typcache.c
@@ -964,7 +964,7 @@ load_multirangetype_info(TypeCacheEntry *typentry)
 {
 	Oid			rangetypeOid;
 
-	rangetypeOid = get_range_multirange_subtype(typentry->type_id);
+	rangetypeOid = get_multirange_range(typentry->type_id);
 	if (!OidIsValid(rangetypeOid))
 		elog(ERROR, "cache lookup failed for multirange type %u",
 			 typentry->type_id);
diff --git a/src/backend/utils/fmgr/funcapi.c b/src/backend/utils/fmgr/funcapi.c
index 3bfefcf48a..ce09d0d128 100644
--- a/src/backend/utils/fmgr/funcapi.c
+++ b/src/backend/utils/fmgr/funcapi.c
@@ -514,7 +514,7 @@ resolve_anyelement_from_others(polymorphic_actuals *actuals)
 		Oid			range_typelem;
 
 		multirange_base_type = getBaseType(actuals->anymultirange_type);
-		multirange_typelem = get_range_multirange_subtype(multirange_base_type);
+		multirange_typelem = get_multirange_range(multirange_base_type);
 		if (!OidIsValid(multirange_typelem))
 			ereport(ERROR,
 					(errcode(ERRCODE_DATATYPE_MISMATCH),
@@ -579,7 +579,7 @@ resolve_anyrange_from_others(polymorphic_actuals *actuals)
 		/* Use the element type based on the multirange type */
 		Oid			multirange_base_type = getBaseType(actuals->anymultirange_type);
 		Oid			multirange_typelem =
-			get_range_multirange_subtype(multirange_base_type);
+			get_multirange_range(multirange_base_type);
 
 		if (!OidIsValid(multirange_typelem))
 			ereport(ERROR,
diff --git a/src/include/utils/lsyscache.h b/src/include/utils/lsyscache.h
index 80410dcd04..e361a7943b 100644
--- a/src/include/utils/lsyscache.h
+++ b/src/include/utils/lsyscache.h
@@ -183,7 +183,7 @@ extern char *get_namespace_name_or_temp(Oid nspid);
 extern Oid	get_range_subtype(Oid rangeOid);
 extern Oid	get_range_collation(Oid rangeOid);
 extern Oid	get_range_multirange(Oid rangeOid);
-extern Oid	get_range_multirange_subtype(Oid multirangeOid);
+extern Oid	get_multirange_range(Oid multirangeOid);
 extern Oid	get_index_column_opclass(Oid index_oid, int attno);
 extern bool	get_index_isreplident(Oid index_oid);
 extern bool get_index_isvalid(Oid index_oid);
-- 
2.20.1

