summaryrefslogtreecommitdiffstats
path: root/src/test/regress/input/create_function_1.source
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/regress/input/create_function_1.source')
-rw-r--r--src/test/regress/input/create_function_1.source105
1 files changed, 105 insertions, 0 deletions
diff --git a/src/test/regress/input/create_function_1.source b/src/test/regress/input/create_function_1.source
new file mode 100644
index 0000000..412e339
--- /dev/null
+++ b/src/test/regress/input/create_function_1.source
@@ -0,0 +1,105 @@
+--
+-- CREATE_FUNCTION_1
+--
+
+CREATE FUNCTION widget_in(cstring)
+ RETURNS widget
+ AS '@libdir@/regress@DLSUFFIX@'
+ LANGUAGE C STRICT IMMUTABLE;
+
+CREATE FUNCTION widget_out(widget)
+ RETURNS cstring
+ AS '@libdir@/regress@DLSUFFIX@'
+ LANGUAGE C STRICT IMMUTABLE;
+
+CREATE FUNCTION int44in(cstring)
+ RETURNS city_budget
+ AS '@libdir@/regress@DLSUFFIX@'
+ LANGUAGE C STRICT IMMUTABLE;
+
+CREATE FUNCTION int44out(city_budget)
+ RETURNS cstring
+ AS '@libdir@/regress@DLSUFFIX@'
+ LANGUAGE C STRICT IMMUTABLE;
+
+CREATE FUNCTION check_primary_key ()
+ RETURNS trigger
+ AS '@libdir@/refint@DLSUFFIX@'
+ LANGUAGE C;
+
+CREATE FUNCTION check_foreign_key ()
+ RETURNS trigger
+ AS '@libdir@/refint@DLSUFFIX@'
+ LANGUAGE C;
+
+CREATE FUNCTION autoinc ()
+ RETURNS trigger
+ AS '@libdir@/autoinc@DLSUFFIX@'
+ LANGUAGE C;
+
+CREATE FUNCTION trigger_return_old ()
+ RETURNS trigger
+ AS '@libdir@/regress@DLSUFFIX@'
+ LANGUAGE C;
+
+CREATE FUNCTION ttdummy ()
+ RETURNS trigger
+ AS '@libdir@/regress@DLSUFFIX@'
+ LANGUAGE C;
+
+CREATE FUNCTION set_ttdummy (int4)
+ RETURNS int4
+ AS '@libdir@/regress@DLSUFFIX@'
+ LANGUAGE C STRICT;
+
+CREATE FUNCTION make_tuple_indirect (record)
+ RETURNS record
+ AS '@libdir@/regress@DLSUFFIX@'
+ LANGUAGE C STRICT;
+
+CREATE FUNCTION test_atomic_ops()
+ RETURNS bool
+ AS '@libdir@/regress@DLSUFFIX@'
+ LANGUAGE C;
+
+-- Tests creating a FDW handler
+CREATE FUNCTION test_fdw_handler()
+ RETURNS fdw_handler
+ AS '@libdir@/regress@DLSUFFIX@', 'test_fdw_handler'
+ LANGUAGE C;
+
+CREATE FUNCTION test_support_func(internal)
+ RETURNS internal
+ AS '@libdir@/regress@DLSUFFIX@', 'test_support_func'
+ LANGUAGE C STRICT;
+
+CREATE FUNCTION test_opclass_options_func(internal)
+ RETURNS void
+ AS '@libdir@/regress@DLSUFFIX@', 'test_opclass_options_func'
+ LANGUAGE C;
+
+-- Things that shouldn't work:
+
+CREATE FUNCTION test1 (int) RETURNS int LANGUAGE SQL
+ AS 'SELECT ''not an integer'';';
+
+CREATE FUNCTION test1 (int) RETURNS int LANGUAGE SQL
+ AS 'not even SQL';
+
+CREATE FUNCTION test1 (int) RETURNS int LANGUAGE SQL
+ AS 'SELECT 1, 2, 3;';
+
+CREATE FUNCTION test1 (int) RETURNS int LANGUAGE SQL
+ AS 'SELECT $2;';
+
+CREATE FUNCTION test1 (int) RETURNS int LANGUAGE SQL
+ AS 'a', 'b';
+
+CREATE FUNCTION test1 (int) RETURNS int LANGUAGE C
+ AS 'nosuchfile';
+
+CREATE FUNCTION test1 (int) RETURNS int LANGUAGE C
+ AS '@libdir@/regress@DLSUFFIX@', 'nosuchsymbol';
+
+CREATE FUNCTION test1 (int) RETURNS int LANGUAGE internal
+ AS 'nosuch';