plcontainer
plcontainer copied to clipboard
ERROR plpy.execute does not support attribute nrows
Expected behavior
result_nrows_test
-------------------
1
(1 row)
Actual behavior
ERROR: PL/Container client exception occurred:
DETAIL:
Exception occurred in Python during function execution
Traceback (most recent call last):
File "<string>", line 5, in result_nrows_test
AttributeError: 'list' object has no attribute 'nrows'
Step to reproduce the behavior
CREATE FUNCTION result_nrows_test(cmd text) RETURNS int AS $$
# container: plc_python_shared
result = plpy.execute(cmd)
return result.nrows()
$$ language plcontainer;
SELECT result_nrows_test($$SELECT 1$$);