mirror of
https://git.postgresql.org/git/postgresql.git
synced 2026-02-15 19:06:59 +08:00
Augment test coverage in PL/Python, especially for error conditions.
This commit is contained in:
@ -1,6 +1,13 @@
|
||||
--
|
||||
-- Test returning SETOF
|
||||
--
|
||||
CREATE FUNCTION test_setof_error() RETURNS SETOF text AS $$
|
||||
return 37
|
||||
$$ LANGUAGE plpythonu;
|
||||
SELECT test_setof_error();
|
||||
ERROR: returned object cannot be iterated
|
||||
DETAIL: PL/Python set-returning functions must return an iterable object.
|
||||
CONTEXT: PL/Python function "test_setof_error"
|
||||
CREATE FUNCTION test_setof_as_list(count integer, content text) RETURNS SETOF text AS $$
|
||||
return [ content ]*count
|
||||
$$ LANGUAGE plpythonu;
|
||||
|
||||
Reference in New Issue
Block a user