BUG #14463: refcursor cann't used with array or variadic parameter?

digoal@126.com

From: digoal@126.com
To: pgsql-bugs@postgresql.org
Date: 2016-12-13T15:25:48Z
Lists: pgsql-bugs
The following bug has been logged on the website:

Bug reference:      14463
Logged by:          Zhou Digoal
Email address:      digoal@126.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


Commits

  1. Improve handling of array elements as getdiag_targets and cursor_variables.