How can a plpython function return result set as a normal sql query resultset (not as text).
Here is function definition -
DROP FUNCTION IF EXISTS demo_report();
CREATE OR REPLACE FUNCTION demo_report()
RETURNS SETOF <what-type>
AS $$
rv = plpy.execute("SELECT * FROM test")
return rv
$$ LANGUAGE plpython3u;
When I execute select demo_report(); it should return the resultset to client rather than text.Right now I am getting this as text -
I am using Postgres 9.2 with plpython3u on Windows.