~vcs-imports/mammoth-replicator/trunk

« back to all changes in this revision

Viewing changes to src/test/regress/output/create_function_1.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_1
 
3
--
 
4
CREATE FUNCTION widget_in(cstring)
 
5
   RETURNS widget
 
6
   AS '@abs_builddir@/regress@DLSUFFIX@'
 
7
   LANGUAGE 'c';
 
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';
 
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';
 
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';
 
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';
 
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" at character 62
 
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"