aboutsummaryrefslogtreecommitdiff
path: root/src/pl/plpython/expected/plpython_spi.out
diff options
context:
space:
mode:
Diffstat (limited to 'src/pl/plpython/expected/plpython_spi.out')
-rw-r--r--src/pl/plpython/expected/plpython_spi.out21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/pl/plpython/expected/plpython_spi.out b/src/pl/plpython/expected/plpython_spi.out
index 9cef3f2bb0b..9097262a48d 100644
--- a/src/pl/plpython/expected/plpython_spi.out
+++ b/src/pl/plpython/expected/plpython_spi.out
@@ -111,3 +111,24 @@ SELECT join_sequences(sequences) FROM sequences
----------------
(0 rows)
+--
+-- plan and result objects
+--
+CREATE FUNCTION result_nrows_test() RETURNS int
+AS $$
+plan = plpy.prepare("SELECT 1 UNION SELECT 2")
+plpy.info(plan.status()) # not really documented or useful
+result = plpy.execute(plan)
+if result.status() > 0:
+ return result.nrows()
+else:
+ return None
+$$ LANGUAGE plpythonu;
+SELECT result_nrows_test();
+INFO: (True,)
+CONTEXT: PL/Python function "result_nrows_test"
+ result_nrows_test
+-------------------
+ 2
+(1 row)
+