创建游标的引用
create function func_test_ref_cursor(refcursor) returns refcursor as $$
begin
open $1 for select * from test limit 100;
return $1;
end
$$language plpgsql;
测试游标
begin;
select func_test_ref_cursor('test_cursor');
fetch all from test_cursor;
rollback;