From 0dba54f1666ead71c54ce100b39efda67596d297 Mon Sep 17 00:00:00 2001
From: Andres Freund <andres@anarazel.de>
Date: Mon, 12 Sep 2016 19:01:16 -0700
Subject: [PATCH] Remove user_relns() SRF from regression tests.

The output of the function changes whenever previous (or, as in this
case, concurrent) tests leave a table in place. That causes unneeded
churn.

This should fix failures due to the tests added bfe16d1a5, like on
lapwing, caused by the tsrf test running concurrently with misc. Those
could also have been addressed by using temp tables, but that test has
annoyed me before.

Discussion: <27626.1473729905@sss.pgh.pa.us>
---
 .../regress/input/create_function_2.source    |   9 --
 src/test/regress/input/misc.source            |   3 -
 .../regress/output/create_function_2.source   |   8 -
 src/test/regress/output/misc.source           | 138 ------------------
 4 files changed, 158 deletions(-)

diff --git a/src/test/regress/input/create_function_2.source b/src/test/regress/input/create_function_2.source
index c5185597775..3c26b2fec6a 100644
--- a/src/test/regress/input/create_function_2.source
+++ b/src/test/regress/input/create_function_2.source
@@ -62,15 +62,6 @@ CREATE FUNCTION equipment_named_ambiguous_2b(hobby text)
    LANGUAGE SQL;
 
 
-CREATE FUNCTION user_relns()
-   RETURNS setof name
-   AS 'select relname
-       from pg_class c, pg_namespace n
-       where relnamespace = n.oid and
-             (nspname !~ ''pg_.*'' and nspname <> ''information_schema'') and
-             relkind <> ''i'' '
-   LANGUAGE SQL;
-
 CREATE FUNCTION pt_in_widget(point, widget)
    RETURNS bool
    AS '@libdir@/regress@DLSUFFIX@'
diff --git a/src/test/regress/input/misc.source b/src/test/regress/input/misc.source
index e16dc21f407..dd2d1b20337 100644
--- a/src/test/regress/input/misc.source
+++ b/src/test/regress/input/misc.source
@@ -218,9 +218,6 @@ SELECT (p.hobbies).equipment.name, name(p.hobbies), p.name FROM ONLY person p;
 
 SELECT name(equipment(p.hobbies)), name(p.hobbies), p.name FROM person* p;
 
-SELECT user_relns() AS user_relns
-   ORDER BY user_relns;
-
 SELECT name(equipment(hobby_construct(text 'skywalking', text 'mer')));
 
 SELECT name(equipment(hobby_construct_named(text 'skywalking', text 'mer')));
diff --git a/src/test/regress/output/create_function_2.source b/src/test/regress/output/create_function_2.source
index 829393243e0..bdd1b1bec56 100644
--- a/src/test/regress/output/create_function_2.source
+++ b/src/test/regress/output/create_function_2.source
@@ -47,14 +47,6 @@ CREATE FUNCTION equipment_named_ambiguous_2b(hobby text)
    RETURNS setof equipment_r
    AS 'select * from equipment_r where equipment_r.hobby = hobby'
    LANGUAGE SQL;
-CREATE FUNCTION user_relns()
-   RETURNS setof name
-   AS 'select relname
-       from pg_class c, pg_namespace n
-       where relnamespace = n.oid and
-             (nspname !~ ''pg_.*'' and nspname <> ''information_schema'') and
-             relkind <> ''i'' '
-   LANGUAGE SQL;
 CREATE FUNCTION pt_in_widget(point, widget)
    RETURNS bool
    AS '@libdir@/regress@DLSUFFIX@'
diff --git a/src/test/regress/output/misc.source b/src/test/regress/output/misc.source
index 5c88aadc5d4..574ef0d2e34 100644
--- a/src/test/regress/output/misc.source
+++ b/src/test/regress/output/misc.source
@@ -574,144 +574,6 @@ SELECT name(equipment(p.hobbies)), name(p.hobbies), p.name FROM person* p;
  peet's coffee | posthacking | jeff
 (6 rows)
 
-SELECT user_relns() AS user_relns
-   ORDER BY user_relns;
-     user_relns      
----------------------
- a
- a_star
- abstime_tbl
- aggtest
- aggtype
- array_index_op_test
- array_op_test
- arrtest
- b
- b_star
- box_tbl
- bprime
- brinopers
- brintest
- bt_f8_heap
- bt_i4_heap
- bt_name_heap
- bt_txt_heap
- btree_tall_tbl
- c
- c_star
- char_tbl
- check2_tbl
- check_seq
- check_tbl
- circle_tbl
- city
- copy_tbl
- d
- d_star
- date_tbl
- default_seq
- default_tbl
- defaultexpr_tbl
- dept
- dupindexcols
- e_star
- emp
- equipment_r
- f_star
- fast_emp4000
- float4_tbl
- float8_tbl
- func_index_heap
- gin_test_tbl
- gist_point_tbl
- hash_f8_heap
- hash_i4_heap
- hash_name_heap
- hash_txt_heap
- hobbies_r
- iexit
- ihighway
- inet_tbl
- inhf
- inhx
- insert_seq
- insert_tbl
- int2_tbl
- int4_tbl
- int8_tbl
- interval_tbl
- iportaltest
- kd_point_tbl
- line_tbl
- log_table
- lseg_tbl
- main_table
- money_data
- mvtest_bb
- mvtest_t
- mvtest_tm
- mvtest_tmm
- mvtest_tv
- mvtest_tvm
- mvtest_tvmm
- mvtest_tvv
- mvtest_tvvm
- mvtest_tvvmv
- num_data
- num_exp_add
- num_exp_div
- num_exp_ln
- num_exp_log10
- num_exp_mul
- num_exp_power_10_ln
- num_exp_sqrt
- num_exp_sub
- num_input_test
- num_result
- onek
- onek2
- path_tbl
- person
- point_tbl
- polygon_tbl
- quad_point_tbl
- radix_text_tbl
- ramp
- random_tbl
- real_city
- reltime_tbl
- rls_tbl
- rls_tbl_force
- road
- shighway
- slow_emp4000
- spgist_point_tbl
- spgist_text_tbl
- street
- stud_emp
- student
- subselect_tbl
- tenk1
- tenk2
- test_range_excl
- test_range_gist
- test_range_spgist
- test_tablesample
- test_tablesample_v1
- test_tablesample_v2
- test_tsvector
- testjsonb
- text_tbl
- time_tbl
- timestamp_tbl
- timestamptz_tbl
- timetz_tbl
- tinterval_tbl
- toyemp
- varchar_tbl
- xacttest
-(132 rows)
-
 SELECT name(equipment(hobby_construct(text 'skywalking', text 'mer')));
  name 
 ------
-- 
GitLab