postgresql/src/test/regress/output/create_function_1.source

62 lines
2.2 KiB
Plaintext
Raw Normal View History

--
-- CREATE_FUNCTION_1
--
CREATE FUNCTION widget_in(opaque)
RETURNS widget
AS '@abs_builddir@/regress@DLSUFFIX@'
LANGUAGE 'c';
WARNING: ProcedureCreate: type widget is not yet defined
CREATE FUNCTION widget_out(opaque)
RETURNS opaque
AS '@abs_builddir@/regress@DLSUFFIX@'
LANGUAGE 'c';
CREATE FUNCTION check_primary_key ()
1997-09-11 11:14:12 +02:00
RETURNS opaque
AS '@abs_builddir@/../../../contrib/spi/refint@DLSUFFIX@'
LANGUAGE 'C';
CREATE FUNCTION check_foreign_key ()
1997-09-11 11:14:12 +02:00
RETURNS opaque
AS '@abs_builddir@/../../../contrib/spi/refint@DLSUFFIX@'
LANGUAGE 'C';
CREATE FUNCTION autoinc ()
RETURNS opaque
AS '@abs_builddir@/../../../contrib/spi/autoinc@DLSUFFIX@'
LANGUAGE 'C';
CREATE FUNCTION funny_dup17 ()
1997-09-11 11:14:12 +02:00
RETURNS opaque
AS '@abs_builddir@/regress@DLSUFFIX@'
LANGUAGE 'C';
CREATE FUNCTION ttdummy ()
1997-09-24 10:36:47 +02:00
RETURNS opaque
AS '@abs_builddir@/regress@DLSUFFIX@'
LANGUAGE 'C';
CREATE FUNCTION set_ttdummy (int4)
1997-09-24 10:36:47 +02:00
RETURNS int4
AS '@abs_builddir@/regress@DLSUFFIX@'
LANGUAGE 'C';
-- 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, returns "unknown"
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE sql
AS 'not even SQL';
ERROR: parser: parse error at or near "not"
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE sql
AS 'SELECT 1, 2, 3;';
ERROR: function declared to return integer returns multiple columns in final SELECT
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE sql
AS 'SELECT $2;';
ERROR: Parameter '$2' is out of range
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE sql
AS 'a', 'b';
ERROR: CREATE FUNCTION: only one AS item needed for sql language
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE c
AS 'nosuchfile';
ERROR: stat failed on file 'nosuchfile': No such file or directory
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE c
AS '@abs_builddir@/regress@DLSUFFIX@', 'nosuchsymbol';
ERROR: Can't find function nosuchsymbol in file @abs_builddir@/regress@DLSUFFIX@
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE internal
AS 'nosuch';
ERROR: there is no built-in function named "nosuch"