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