create or replace function subs()
RETURNS VOID AS $$
DECLARE
hs record;
resultado text[];
hs_2 text[];
BEGIN
for hs in select product_hs from _2018_cabezal_exp limit 100
loop
hs_2 := hs.product_hs;
raise notice '%', hs_2;
end loop;
end;
$$ language plpgsql;
SELECT array( SELECT substring(unnest('{8414,8532,8533,8536}'::text[]),1,2) )