Consistently use "superuser" instead of "super user"
[pgsql.git] / src / test / regress / input / create_function_2.source
blob9e6d2942ec7f151632d7f4e0cb9ae89f6bc0b013
1 --
2 -- CREATE_FUNCTION_2
3 --
4 CREATE FUNCTION hobbies(person)
5    RETURNS setof hobbies_r
6    AS 'select * from hobbies_r where person = $1.name'
7    LANGUAGE SQL;
10 CREATE FUNCTION hobby_construct(text, text)
11    RETURNS hobbies_r
12    AS 'select $1 as name, $2 as hobby'
13    LANGUAGE SQL;
16 CREATE FUNCTION hobby_construct_named(name text, hobby text)
17    RETURNS hobbies_r
18    AS 'select name, hobby'
19    LANGUAGE SQL;
22 CREATE FUNCTION hobbies_by_name(hobbies_r.name%TYPE)
23    RETURNS hobbies_r.person%TYPE
24    AS 'select person from hobbies_r where name = $1'
25    LANGUAGE SQL;
28 CREATE FUNCTION equipment(hobbies_r)
29    RETURNS setof equipment_r
30    AS 'select * from equipment_r where hobby = $1.name'
31    LANGUAGE SQL;
34 CREATE FUNCTION equipment_named(hobby hobbies_r)
35    RETURNS setof equipment_r
36    AS 'select * from equipment_r where equipment_r.hobby = equipment_named.hobby.name'
37    LANGUAGE SQL;
39 CREATE FUNCTION equipment_named_ambiguous_1a(hobby hobbies_r)
40    RETURNS setof equipment_r
41    AS 'select * from equipment_r where hobby = equipment_named_ambiguous_1a.hobby.name'
42    LANGUAGE SQL;
44 CREATE FUNCTION equipment_named_ambiguous_1b(hobby hobbies_r)
45    RETURNS setof equipment_r
46    AS 'select * from equipment_r where equipment_r.hobby = hobby.name'
47    LANGUAGE SQL;
49 CREATE FUNCTION equipment_named_ambiguous_1c(hobby hobbies_r)
50    RETURNS setof equipment_r
51    AS 'select * from equipment_r where hobby = hobby.name'
52    LANGUAGE SQL;
54 CREATE FUNCTION equipment_named_ambiguous_2a(hobby text)
55    RETURNS setof equipment_r
56    AS 'select * from equipment_r where hobby = equipment_named_ambiguous_2a.hobby'
57    LANGUAGE SQL;
59 CREATE FUNCTION equipment_named_ambiguous_2b(hobby text)
60    RETURNS setof equipment_r
61    AS 'select * from equipment_r where equipment_r.hobby = hobby'
62    LANGUAGE SQL;
65 CREATE FUNCTION pt_in_widget(point, widget)
66    RETURNS bool
67    AS '@libdir@/regress@DLSUFFIX@'
68    LANGUAGE C STRICT;
70 CREATE FUNCTION overpaid(emp)
71    RETURNS bool
72    AS '@libdir@/regress@DLSUFFIX@'
73    LANGUAGE C STRICT;
75 CREATE FUNCTION interpt_pp(path, path)
76    RETURNS point
77    AS '@libdir@/regress@DLSUFFIX@'
78    LANGUAGE C STRICT;
80 CREATE FUNCTION reverse_name(name)
81    RETURNS name
82    AS '@libdir@/regress@DLSUFFIX@'
83    LANGUAGE C STRICT;
86 -- Function dynamic loading
88 LOAD '@libdir@/regress@DLSUFFIX@';