Subject: [PATCH v11 3/4] whitespace tweaks

From: Alvaro Herrera <[email-masked]>
Date: Tue, 3 Mar 2020 15:09:56 -0300

---
 src/backend/utils/adt/multirangetypes.c | 15 +++++++--------
 src/include/catalog/pg_range.h          |  6 +++---
 2 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/src/backend/utils/adt/multirangetypes.c b/src/backend/utils/adt/multirangetypes.c
index f9dd0378cc..0c9afd5448 100644
--- a/src/backend/utils/adt/multirangetypes.c
+++ b/src/backend/utils/adt/multirangetypes.c
@@ -174,12 +174,11 @@ multirange_in(PG_FUNCTION_ARGS)
 					if (range_capacity == range_count)
 					{
 						range_capacity *= 2;
-						ranges = (RangeType **) repalloc(ranges,
-														 range_capacity * sizeof(RangeType *));
+						ranges = (RangeType **)
+							repalloc(ranges, range_capacity * sizeof(RangeType *));
 					}
 					ranges_seen++;
-					range = DatumGetRangeTypeP(
-											   InputFunctionCall(&cache->proc, range_str_copy,
+					range = DatumGetRangeTypeP(InputFunctionCall(&cache->proc, range_str_copy,
 																 cache->typioparam, typmod));
 					if (!RangeIsEmpty(range))
 						ranges[range_count++] = range;
@@ -376,11 +375,11 @@ multirange_typanalyze(PG_FUNCTION_ARGS)
  * pointer to a type cache entry.
  */
 static MultirangeIOData *
-get_multirange_io_data(FunctionCallInfo fcinfo, Oid mltrngtypid, IOFuncSelector func)
+get_multirange_io_data(FunctionCallInfo fcinfo, Oid rngtypid, IOFuncSelector func)
 {
 	MultirangeIOData *cache = (MultirangeIOData *) fcinfo->flinfo->fn_extra;
 
-	if (cache == NULL || cache->typcache->type_id != mltrngtypid)
+	if (cache == NULL || cache->typcache->type_id != rngtypid)
 	{
 		int16		typlen;
 		bool		typbyval;
@@ -389,9 +388,9 @@ get_multirange_io_data(FunctionCallInfo fcinfo, Oid mltrngtypid, IOFuncSelector
 
 		cache = (MultirangeIOData *) MemoryContextAlloc(fcinfo->flinfo->fn_mcxt,
 														sizeof(MultirangeIOData));
-		cache->typcache = lookup_type_cache(mltrngtypid, TYPECACHE_MULTIRANGE_INFO);
+		cache->typcache = lookup_type_cache(rngtypid, TYPECACHE_MULTIRANGE_INFO);
 		if (cache->typcache->rngtype == NULL)
-			elog(ERROR, "type %u is not a multirange type", mltrngtypid);
+			elog(ERROR, "type %u is not a multirange type", rngtypid);
 
 		/* get_type_io_data does more than we need, but is convenient */
 		get_type_io_data(cache->typcache->rngtype->type_id,
diff --git a/src/include/catalog/pg_range.h b/src/include/catalog/pg_range.h
index 3efd463c6d..60a8fde518 100644
--- a/src/include/catalog/pg_range.h
+++ b/src/include/catalog/pg_range.h
@@ -34,6 +34,9 @@ CATALOG(pg_range,3541,RangeRelationId)
 	/* OID of range's element type (subtype) */
 	Oid			rngsubtype BKI_LOOKUP(pg_type);
 
+	/* OID of the range's multirange type */
+	Oid			rngmultitypid BKI_LOOKUP(pg_type);
+
 	/* collation for this range type, or 0 */
 	Oid			rngcollation BKI_DEFAULT(0);
 
@@ -45,9 +48,6 @@ CATALOG(pg_range,3541,RangeRelationId)
 
 	/* subtype difference as a float8, or 0 */
 	regproc		rngsubdiff BKI_LOOKUP(pg_proc);
-
-	/* OID of the range's multirange type */
-	Oid			rngmultitypid BKI_LOOKUP(pg_type);
 } FormData_pg_range;
 
 /* ----------------
-- 
2.20.1

--wRRV7LY7NUeQGEoC
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="v11-0004-Various-tweaks-mostly-naming.patch"