-- Function: public.fnc_conta_record_tabelle()
-- DROP FUNCTION public.fnc_conta_record_tabelle();
CREATE OR REPLACE FUNCTION public.fnc_conta_record_tabelle()
RETURNS TABLE(tabella character varying, numero_record numeric) AS
$BODY$
DECLARE
R record;
Tabella character varying ARRAY; -- DEFAULT ARRAY['TOPO1', 'PIPPO1', 'CECO3'];
Conteggio numeric ARRAY;-- DEFAULT ARRAY[11,12,13,14,15,16];
xxx numeric:= 0;
yyy numeric:= 0;
i numeric:= 0;
BEGIN
-- RAISE NOTICE 'array_dims(anyarray) (%)', array_dims(test1);
For R in (Select t.tablename,
ROW_NUMBER () OVER () as Indx
from pg_tables t
where t.schemaname = 'public'
and [...]