diff options
Diffstat (limited to 'src/pl/plpython/expected/plpython_spi.out')
-rw-r--r-- | src/pl/plpython/expected/plpython_spi.out | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/pl/plpython/expected/plpython_spi.out b/src/pl/plpython/expected/plpython_spi.out index 3cda9589b3c..b07a4294392 100644 --- a/src/pl/plpython/expected/plpython_spi.out +++ b/src/pl/plpython/expected/plpython_spi.out @@ -263,6 +263,24 @@ CONTEXT: PL/Python function "result_empty_test" (1 row) +CREATE FUNCTION result_str_test(cmd text) RETURNS text +AS $$ +plan = plpy.prepare(cmd) +result = plpy.execute(plan) +return str(result) +$$ LANGUAGE plpythonu; +SELECT result_str_test($$SELECT 1 AS foo, '11'::text AS bar UNION SELECT 2, '22'$$); + result_str_test +-------------------------------------------------------------------------------------- + <PLyResult status=5 nrows=2 rows=[{'foo': 1, 'bar': '11'}, {'foo': 2, 'bar': '22'}]> +(1 row) + +SELECT result_str_test($$CREATE TEMPORARY TABLE foo1 (a int, b text)$$); + result_str_test +-------------------------------------- + <PLyResult status=4 nrows=0 rows=[]> +(1 row) + -- cursor objects CREATE FUNCTION simple_cursor_test() RETURNS int AS $$ res = plpy.cursor("select fname, lname from users") |