The following bug has been logged on the website:
Bug reference: 14463
Logged by: Zhou Digoal
Email address: digoal(at)126(dot)com
PostgreSQL version: 9.6.1
Operating system: CentOS 6.x x64
Description:
postgres=# CREATE FUNCTION myfunc(variadic ref refcursor[]) RETURNS SETOF
refcursor AS $$
begin
open ref[1] for select * from pg_class;
return next ref[1];
open ref[2] for select * from pg_class;
return next ref[2];
end;
$$ lANGUAGE plpgsql;
ERROR: 42804: variable "$1" must be of type cursor or refcursor
LINE 3: open ref[1] for select * from pg_class;
^
LOCATION: plpgsql_yyparse, pl_gram.y:2187
Time: 0.854 ms