我有以下函数(使用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;
在创建方面没有问题,我在psql中运行函数,得到如下结果:
select from toto();
NOTICE: HERE {055,056,057,058,059}
--
(1 row)
通知显示了正确的结果。我不明白的是为什么结果本身没有显示?我哪里错了吗? 非常感谢您提供的任何指针和帮助。
select toto()
orselect * from toto()
- user330315SELECT * FROM UNNEST(toto())
。 - Camille