aboutsummaryrefslogtreecommitdiff
path: root/src/pl/plpython/sql/plpython_spi.sql
diff options
context:
space:
mode:
Diffstat (limited to 'src/pl/plpython/sql/plpython_spi.sql')
-rw-r--r--src/pl/plpython/sql/plpython_spi.sql7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/pl/plpython/sql/plpython_spi.sql b/src/pl/plpython/sql/plpython_spi.sql
index b828744d1f8..d8457ce98c5 100644
--- a/src/pl/plpython/sql/plpython_spi.sql
+++ b/src/pl/plpython/sql/plpython_spi.sql
@@ -93,9 +93,9 @@ SELECT join_sequences(sequences) FROM sequences
-- plan and result objects
--
-CREATE FUNCTION result_nrows_test() RETURNS int
+CREATE FUNCTION result_metadata_test(cmd text) RETURNS int
AS $$
-plan = plpy.prepare("SELECT 1 AS foo, '11'::text AS bar UNION SELECT 2, '22'")
+plan = plpy.prepare(cmd)
plpy.info(plan.status()) # not really documented or useful
result = plpy.execute(plan)
if result.status() > 0:
@@ -107,7 +107,8 @@ else:
return None
$$ LANGUAGE plpythonu;
-SELECT result_nrows_test();
+SELECT result_metadata_test($$SELECT 1 AS foo, '11'::text AS bar UNION SELECT 2, '22'$$);
+SELECT result_metadata_test($$CREATE TEMPORARY TABLE foo1 (a int, b text)$$);
-- cursor objects