IN my postgresql 13.2 version database, the "refcursor" is not working. when am i storing the select query output to refcursor variable, it is throwing below error.
create function testing(val character varying)
return t_cur
language plpgsql
as $function$
declare
v_return t_cur;
begin
open v_return.v_output for select * from tbl_master where id = val;
return v_return;
end;
$function$
In this stored procedure "t_cur" is user defined type. and v_output is refcursor variable.
Error:
Error: cursor variable must be a simple variable
LINE 67: open V_RETURN.V_OUTPUT for select * from...
This same stored procedure is working properly in postgresql version 9.6
So please explain what is replacement of refcursor in postgresql 13.2 verson. or what is the solution for this?