summaryrefslogtreecommitdiff
path: root/src/test/regress/output/create_function_1.source
blob: d2f2843a45c599e7ae4a8ac487992e9404fe31db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
--
-- CREATE_FUNCTION_1
--
CREATE FUNCTION widget_in(cstring)
   RETURNS widget
   AS '@libdir@/regress@DLSUFFIX@'
   LANGUAGE C STRICT;
NOTICE:  type "widget" is not yet defined
DETAIL:  Creating a shell type definition.
CREATE FUNCTION widget_out(widget)
   RETURNS cstring
   AS '@libdir@/regress@DLSUFFIX@'
   LANGUAGE C STRICT;
NOTICE:  argument type widget is only a shell
CREATE FUNCTION int44in(cstring)
   RETURNS city_budget
   AS '@libdir@/regress@DLSUFFIX@'
   LANGUAGE C STRICT;
NOTICE:  type "city_budget" is not yet defined
DETAIL:  Creating a shell type definition.
CREATE FUNCTION int44out(city_budget)
   RETURNS cstring
   AS '@libdir@/regress@DLSUFFIX@'
   LANGUAGE C STRICT;
NOTICE:  argument type city_budget is only a shell
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 funny_dup17 ()
        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;
-- Things that shouldn't work:
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE SQL
    AS 'SELECT ''not an integer'';';
ERROR:  return type mismatch in function declared to return integer
DETAIL:  Actual return type is unknown.
CONTEXT:  SQL function "test1"
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE SQL
    AS 'not even SQL';
ERROR:  syntax error at or near "not"
LINE 2:     AS 'not even SQL';
                ^
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE SQL
    AS 'SELECT 1, 2, 3;';
ERROR:  return type mismatch in function declared to return integer
DETAIL:  Final SELECT must return exactly one column.
CONTEXT:  SQL function "test1"
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE SQL
    AS 'SELECT $2;';
ERROR:  there is no parameter $2
LINE 2:     AS 'SELECT $2;';
                       ^
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE SQL
    AS 'a', 'b';
ERROR:  only one AS item needed for language "sql"
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE C
    AS 'nosuchfile';
ERROR:  could not access file "nosuchfile": No such file or directory
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE C
    AS '@libdir@/regress@DLSUFFIX@', 'nosuchsymbol';
ERROR:  could not find function "nosuchsymbol" in file "@libdir@/regress@DLSUFFIX@"
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE internal
    AS 'nosuch';
ERROR:  there is no built-in function named "nosuch"