2 -- Tests for functions that return void
4 CREATE FUNCTION test_void_func1() RETURNS void AS $$
7 -- illegal: can't return non-None value in void-returning func
8 CREATE FUNCTION test_void_func2() RETURNS void AS $$
10 $$ LANGUAGE plpythonu;
11 CREATE FUNCTION test_return_none() RETURNS int AS $$
13 $$ LANGUAGE plpythonu;
14 -- Tests for functions returning void
15 SELECT test_void_func1(), test_void_func1() IS NULL AS "is null";
16 test_void_func1 | is null
17 -----------------+---------
21 SELECT test_void_func2(); -- should fail
22 ERROR: PL/Python function with return type "void" did not return None
23 CONTEXT: while creating return value
24 PL/Python function "test_void_func2"
25 SELECT test_return_none(), test_return_none() IS NULL AS "is null";
26 test_return_none | is null
27 ------------------+---------