~vcs-imports/mammoth-replicator/trunk

« back to all changes in this revision

Viewing changes to src/test/regress/input/create_function_2.source

  • Committer: alvherre
  • Date: 2005-12-16 21:24:52 UTC
  • Revision ID: svn-v4:db760fc0-0f08-0410-9d63-cc6633f64896:trunk:1
Initial import of the REL8_0_3 sources from the Pgsql CVS repository.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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';
 
8
 
 
9
 
 
10
CREATE FUNCTION hobby_construct(text, text)
 
11
   RETURNS hobbies_r
 
12
   AS 'select $1 as name, $2 as hobby'
 
13
   LANGUAGE 'sql';
 
14
 
 
15
 
 
16
CREATE FUNCTION hobbies_by_name(hobbies_r.name%TYPE)
 
17
   RETURNS hobbies_r.person%TYPE
 
18
   AS 'select person from hobbies_r where name = $1'
 
19
   LANGUAGE 'sql';
 
20
 
 
21
 
 
22
CREATE FUNCTION equipment(hobbies_r)
 
23
   RETURNS setof equipment_r
 
24
   AS 'select * from equipment_r where hobby = $1.name'
 
25
   LANGUAGE 'sql';
 
26
 
 
27
 
 
28
CREATE FUNCTION user_relns()
 
29
   RETURNS setof name
 
30
   AS 'select relname 
 
31
       from pg_class c, pg_namespace n
 
32
       where relnamespace = n.oid and
 
33
             (nspname !~ ''pg_.*'' and nspname <> ''information_schema'') and
 
34
             relkind <> ''i'' '
 
35
   LANGUAGE 'sql';
 
36
 
 
37
CREATE FUNCTION pt_in_widget(point, widget)
 
38
   RETURNS bool
 
39
   AS '@abs_builddir@/regress@DLSUFFIX@'
 
40
   LANGUAGE 'C';
 
41
 
 
42
CREATE FUNCTION overpaid(emp)
 
43
   RETURNS bool
 
44
   AS '@abs_builddir@/regress@DLSUFFIX@'
 
45
   LANGUAGE 'C';
 
46
 
 
47
CREATE FUNCTION boxarea(box)
 
48
   RETURNS float8
 
49
   AS '@abs_builddir@/regress@DLSUFFIX@'
 
50
   LANGUAGE 'C';
 
51
 
 
52
CREATE FUNCTION interpt_pp(path, path)
 
53
   RETURNS point
 
54
   AS '@abs_builddir@/regress@DLSUFFIX@'
 
55
   LANGUAGE 'C';
 
56
 
 
57
CREATE FUNCTION reverse_name(name)
 
58
   RETURNS name
 
59
   AS '@abs_builddir@/regress@DLSUFFIX@'
 
60
   LANGUAGE 'c';
 
61
 
 
62
CREATE FUNCTION oldstyle_length(int4, text)
 
63
   RETURNS int4
 
64
   AS '@abs_builddir@/regress@DLSUFFIX@'
 
65
   LANGUAGE 'c';
 
66
 
 
67
--
 
68
-- Function dynamic loading
 
69
--
 
70
LOAD '@abs_builddir@/regress@DLSUFFIX@';
 
71