diff --git a/src/test/regress/expected/opr_sanity.out b/src/test/regress/expected/opr_sanity.out
index 330eb0f765..02f5348ab1 100644
--- a/src/test/regress/expected/opr_sanity.out
+++ b/src/test/regress/expected/opr_sanity.out
@@ -472,6 +472,37 @@ WHERE proallargtypes IS NOT NULL AND
 -----+---------+-------------+----------------+-------------
 (0 rows)
 
+-- Check for type of the variadic array parameter's elements.
+-- provariadic should be ANYOID if the type of the last element is ANYOID,
+-- ANYELEMENTOID if the type of the last element is ANYARRAYOID,
+-- ANYCOMPATIBLEOID if the type of the last element is ANYCOMPATIBLEARRAYOID,
+-- and otherwise the element type corresponding to the array type.
+SELECT oid::regprocedure, provariadic::regtype, proargtypes::regtype[]
+FROM pg_proc
+WHERE provariadic != 0
+AND case proargtypes[array_length(proargtypes, 1)-1]
+	WHEN '"any"'::regtype THEN '"any"'::regtype
+	WHEN 'anyarray'::regtype THEN 'anyelement'::regtype
+	WHEN 'anycompatiblearray'::regtype THEN 'anycompatible'::regtype
+	ELSE (SELECT t.oid
+		  FROM pg_type t
+		  WHERE t.typarray = proargtypes[array_length(proargtypes, 1)-1])
+	END  != provariadic;
+ oid | provariadic | proargtypes 
+-----+-------------+-------------
+(0 rows)
+
+-- Check that all and only those functions with a variadic type have
+-- a variadic argument.
+SELECT oid::regprocedure, proargmodes, provariadic
+FROM pg_proc
+WHERE (proargmodes IS NOT NULL AND 'v' = any(proargmodes))
+    IS DISTINCT FROM
+    (provariadic != 0);
+ oid | proargmodes | provariadic 
+-----+-------------+-------------
+(0 rows)
+
 -- Check for prosupport functions with the wrong signature
 SELECT p1.oid, p1.proname, p2.oid, p2.proname
 FROM pg_proc AS p1, pg_proc AS p2
diff --git a/src/test/regress/expected/type_sanity.out b/src/test/regress/expected/type_sanity.out
index d3ac08c9ee..a640cfc476 100644
--- a/src/test/regress/expected/type_sanity.out
+++ b/src/test/regress/expected/type_sanity.out
@@ -132,37 +132,6 @@ WHERE t1.typinput = p1.oid AND NOT
 -----+---------+-----+---------
 (0 rows)
 
--- Check for type of the variadic array parameter's elements.
--- provariadic should be ANYOID if the type of the last element is ANYOID,
--- ANYELEMENTOID if the type of the last element is ANYARRAYOID,
--- ANYCOMPATIBLEOID if the type of the last element is ANYCOMPATIBLEARRAYOID,
--- and otherwise the element type corresponding to the array type.
-SELECT oid::regprocedure, provariadic::regtype, proargtypes::regtype[]
-FROM pg_proc
-WHERE provariadic != 0
-AND case proargtypes[array_length(proargtypes, 1)-1]
-	WHEN '"any"'::regtype THEN '"any"'::regtype
-	WHEN 'anyarray'::regtype THEN 'anyelement'::regtype
-	WHEN 'anycompatiblearray'::regtype THEN 'anycompatible'::regtype
-	ELSE (SELECT t.oid
-		  FROM pg_type t
-		  WHERE t.typarray = proargtypes[array_length(proargtypes, 1)-1])
-	END  != provariadic;
- oid | provariadic | proargtypes 
------+-------------+-------------
-(0 rows)
-
--- Check that all and only those functions with a variadic type have
--- a variadic argument.
-SELECT oid::regprocedure, proargmodes, provariadic
-FROM pg_proc
-WHERE (proargmodes IS NOT NULL AND 'v' = any(proargmodes))
-    IS DISTINCT FROM
-    (provariadic != 0);
- oid | proargmodes | provariadic 
------+-------------+-------------
-(0 rows)
-
 -- As of 8.0, this check finds refcursor, which is borrowing
 -- other types' I/O routines
 SELECT t1.oid, t1.typname, p1.oid, p1.proname
diff --git a/src/test/regress/sql/opr_sanity.sql b/src/test/regress/sql/opr_sanity.sql
index 2b292851e3..56b54ba988 100644
--- a/src/test/regress/sql/opr_sanity.sql
+++ b/src/test/regress/sql/opr_sanity.sql
@@ -344,6 +344,32 @@ WHERE proallargtypes IS NOT NULL AND
         FROM generate_series(1, array_length(proallargtypes, 1)) g(i)
         WHERE proargmodes IS NULL OR proargmodes[i] IN ('i', 'b', 'v'));
 
+-- Check for type of the variadic array parameter's elements.
+-- provariadic should be ANYOID if the type of the last element is ANYOID,
+-- ANYELEMENTOID if the type of the last element is ANYARRAYOID,
+-- ANYCOMPATIBLEOID if the type of the last element is ANYCOMPATIBLEARRAYOID,
+-- and otherwise the element type corresponding to the array type.
+
+SELECT oid::regprocedure, provariadic::regtype, proargtypes::regtype[]
+FROM pg_proc
+WHERE provariadic != 0
+AND case proargtypes[array_length(proargtypes, 1)-1]
+	WHEN '"any"'::regtype THEN '"any"'::regtype
+	WHEN 'anyarray'::regtype THEN 'anyelement'::regtype
+	WHEN 'anycompatiblearray'::regtype THEN 'anycompatible'::regtype
+	ELSE (SELECT t.oid
+		  FROM pg_type t
+		  WHERE t.typarray = proargtypes[array_length(proargtypes, 1)-1])
+	END  != provariadic;
+
+-- Check that all and only those functions with a variadic type have
+-- a variadic argument.
+SELECT oid::regprocedure, proargmodes, provariadic
+FROM pg_proc
+WHERE (proargmodes IS NOT NULL AND 'v' = any(proargmodes))
+    IS DISTINCT FROM
+    (provariadic != 0);
+
 -- Check for prosupport functions with the wrong signature
 SELECT p1.oid, p1.proname, p2.oid, p2.proname
 FROM pg_proc AS p1, pg_proc AS p2
diff --git a/src/test/regress/sql/type_sanity.sql b/src/test/regress/sql/type_sanity.sql
index 5edc1f1f6e..79ec410a6c 100644
--- a/src/test/regress/sql/type_sanity.sql
+++ b/src/test/regress/sql/type_sanity.sql
@@ -105,32 +105,6 @@ WHERE t1.typinput = p1.oid AND NOT
       p1.proargtypes[1] = 'oid'::regtype AND
       p1.proargtypes[2] = 'int4'::regtype));
 
--- Check for type of the variadic array parameter's elements.
--- provariadic should be ANYOID if the type of the last element is ANYOID,
--- ANYELEMENTOID if the type of the last element is ANYARRAYOID,
--- ANYCOMPATIBLEOID if the type of the last element is ANYCOMPATIBLEARRAYOID,
--- and otherwise the element type corresponding to the array type.
-
-SELECT oid::regprocedure, provariadic::regtype, proargtypes::regtype[]
-FROM pg_proc
-WHERE provariadic != 0
-AND case proargtypes[array_length(proargtypes, 1)-1]
-	WHEN '"any"'::regtype THEN '"any"'::regtype
-	WHEN 'anyarray'::regtype THEN 'anyelement'::regtype
-	WHEN 'anycompatiblearray'::regtype THEN 'anycompatible'::regtype
-	ELSE (SELECT t.oid
-		  FROM pg_type t
-		  WHERE t.typarray = proargtypes[array_length(proargtypes, 1)-1])
-	END  != provariadic;
-
--- Check that all and only those functions with a variadic type have
--- a variadic argument.
-SELECT oid::regprocedure, proargmodes, provariadic
-FROM pg_proc
-WHERE (proargmodes IS NOT NULL AND 'v' = any(proargmodes))
-    IS DISTINCT FROM
-    (provariadic != 0);
-
 -- As of 8.0, this check finds refcursor, which is borrowing
 -- other types' I/O routines
 SELECT t1.oid, t1.typname, p1.oid, p1.proname