summaryrefslogtreecommitdiff
path: root/src/pl/plpython/expected/plpython_function.out
diff options
context:
space:
mode:
authorNeil Conway <neilc@samurai.com>2006-02-28 20:03:52 +0000
committerNeil Conway <neilc@samurai.com>2006-02-28 20:03:52 +0000
commit87daae1143520309da299b78a8e7a68f141a268f (patch)
tree3ad11f9a73ee33a908d877869f88b79c1afaed63 /src/pl/plpython/expected/plpython_function.out
parentc6b6f7ad6417ea64c4f56507b85287db97ce508c (diff)
Allow PL/Python functions to return void, per gripe from James Robinson
(I didn't use his patch, however). A void-returning PL/Python function must return None (from Python), which is translated into a void datum (and *not* NULL) for Postgres. I also added some regression tests for this functionality.
Diffstat (limited to 'src/pl/plpython/expected/plpython_function.out')
-rw-r--r--src/pl/plpython/expected/plpython_function.out11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/pl/plpython/expected/plpython_function.out b/src/pl/plpython/expected/plpython_function.out
index 516d0576899..dc52f4af17d 100644
--- a/src/pl/plpython/expected/plpython_function.out
+++ b/src/pl/plpython/expected/plpython_function.out
@@ -289,3 +289,14 @@ plan = plpy.prepare("SELECT $1 AS testvalue1, $2 AS testvalue2", ["text", "text"
rv = plpy.execute(plan, u"\\x80", 1)
return rv[0]["testvalue1"]
' LANGUAGE plpythonu;
+-- Tests for functions that return void
+CREATE FUNCTION test_void_func1() RETURNS void AS $$
+x = 10
+$$ LANGUAGE plpythonu;
+-- illegal: can't return non-None value in void-returning func
+CREATE FUNCTION test_void_func2() RETURNS void AS $$
+return 10
+$$ LANGUAGE plpythonu;
+CREATE FUNCTION test_return_none() RETURNS int AS $$
+None
+$$ LANGUAGE plpythonu;