I have the following function (using postgres 9.4)
create or replace function toto() RETURNS text[] AS $$
DECLARE
threed text[];
BEGIN
select array (select tata from hello) into threed;
raise notice 'HERE %',threed;
return threed;
END;
$$ LANGUAGE plpgsql;
No problem on creation, I ran the function in psql and I get:
select from toto();
NOTICE: HERE {055,056,057,058,059}
--
(1 row)
The notice displays the correct results. What I do not understand is why the results themselves are not displayed ? Where am I wrong ? Thanks for any pointer and help
select toto()orselect * from toto()SELECT * FROM UNNEST(toto())