summaryrefslogtreecommitdiff
path: root/src/test/regress/sql/create_function_2.sql
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2022-02-08 15:30:38 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2022-02-08 15:30:38 -0500
commitcc50080a828dd4791b43539f5a0f976e535d147c (patch)
tree787184da35163d8be525b7f84af85083e50d152a /src/test/regress/sql/create_function_2.sql
parentba15f16107bea8a93edc505f3013cd7df4ac90fc (diff)
Rearrange core regression tests to reduce cross-script dependencies.
The idea behind this patch is to make it possible to run individual test scripts without running the entire core test suite. Making all the scripts completely independent would involve a massive rewrite, and would probably be worse for coverage of things like concurrent DDL. So this patch just does what seems practical with limited changes. The net effect is that any test script can be run after running limited earlier dependencies: * all scripts depend on test_setup * many scripts depend on create_index * other dependencies are few in number, and are documented in the parallel_schedule file. To accomplish this, I chose a small number of commonly-used tables and moved their creation and filling into test_setup. Later scripts are expected not to modify these tables' data contents, for fear of affecting other scripts' results. Also, our former habit of declaring all C functions in one place is now gone in favor of declaring them where they're used, if that's just one script, or in test_setup if necessary. There's more that could be done to remove some of the remaining inter-script dependencies, but significantly more-invasive changes would be needed, and at least for now it doesn't seem worth it. Discussion: https://postgr.es/m/1114748.1640383217@sss.pgh.pa.us
Diffstat (limited to 'src/test/regress/sql/create_function_2.sql')
-rw-r--r--src/test/regress/sql/create_function_2.sql96
1 files changed, 0 insertions, 96 deletions
diff --git a/src/test/regress/sql/create_function_2.sql b/src/test/regress/sql/create_function_2.sql
deleted file mode 100644
index 67510aed239..00000000000
--- a/src/test/regress/sql/create_function_2.sql
+++ /dev/null
@@ -1,96 +0,0 @@
---
--- CREATE_FUNCTION_2
---
-
--- directory path and dlsuffix are passed to us in environment variables
-\getenv libdir PG_LIBDIR
-\getenv dlsuffix PG_DLSUFFIX
-
-\set regresslib :libdir '/regress' :dlsuffix
-
-
-CREATE FUNCTION hobbies(person)
- RETURNS setof hobbies_r
- AS 'select * from hobbies_r where person = $1.name'
- LANGUAGE SQL;
-
-
-CREATE FUNCTION hobby_construct(text, text)
- RETURNS hobbies_r
- AS 'select $1 as name, $2 as hobby'
- LANGUAGE SQL;
-
-
-CREATE FUNCTION hobby_construct_named(name text, hobby text)
- RETURNS hobbies_r
- AS 'select name, hobby'
- LANGUAGE SQL;
-
-
-CREATE FUNCTION hobbies_by_name(hobbies_r.name%TYPE)
- RETURNS hobbies_r.person%TYPE
- AS 'select person from hobbies_r where name = $1'
- LANGUAGE SQL;
-
-
-CREATE FUNCTION equipment(hobbies_r)
- RETURNS setof equipment_r
- AS 'select * from equipment_r where hobby = $1.name'
- LANGUAGE SQL;
-
-
-CREATE FUNCTION equipment_named(hobby hobbies_r)
- RETURNS setof equipment_r
- AS 'select * from equipment_r where equipment_r.hobby = equipment_named.hobby.name'
- LANGUAGE SQL;
-
-CREATE FUNCTION equipment_named_ambiguous_1a(hobby hobbies_r)
- RETURNS setof equipment_r
- AS 'select * from equipment_r where hobby = equipment_named_ambiguous_1a.hobby.name'
- LANGUAGE SQL;
-
-CREATE FUNCTION equipment_named_ambiguous_1b(hobby hobbies_r)
- RETURNS setof equipment_r
- AS 'select * from equipment_r where equipment_r.hobby = hobby.name'
- LANGUAGE SQL;
-
-CREATE FUNCTION equipment_named_ambiguous_1c(hobby hobbies_r)
- RETURNS setof equipment_r
- AS 'select * from equipment_r where hobby = hobby.name'
- LANGUAGE SQL;
-
-CREATE FUNCTION equipment_named_ambiguous_2a(hobby text)
- RETURNS setof equipment_r
- AS 'select * from equipment_r where hobby = equipment_named_ambiguous_2a.hobby'
- LANGUAGE SQL;
-
-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 pt_in_widget(point, widget)
- RETURNS bool
- AS :'regresslib'
- LANGUAGE C STRICT;
-
-CREATE FUNCTION overpaid(emp)
- RETURNS bool
- AS :'regresslib'
- LANGUAGE C STRICT;
-
-CREATE FUNCTION interpt_pp(path, path)
- RETURNS point
- AS :'regresslib'
- LANGUAGE C STRICT;
-
-CREATE FUNCTION reverse_name(name)
- RETURNS name
- AS :'regresslib'
- LANGUAGE C STRICT;
-
---
--- Function dynamic loading
---
-LOAD :'regresslib';