Código PHP:
   create or replace function GetRows() returns setof record as
$BODY$
declare
r record;
begin
for r in 
    EXECUTE ''select * from tb_empresa'' 
loop
    return next r;
end loop;
 
return;
end;$BODY$
LANGUAGE 'plpgsql' 
    Código PHP:
   Select * from GetRows() 
    Código PHP:
   >[Error] Script lines: 1-1 --------------------------
 ERROR: a column definition list is required for functions returning "record"
 Line: 1  
     
 



