Is there any way in Postgres to apply a function over a results of an array (or any sort of collection)?
For example if I have a function create function add1...
that increments a number by one, is there any way to do something like:
select map add1 array[1,5,8...];
and getting back
array [2,6,9...]
?
I am not sure if it has any sense over a select
as it can map a function on the single result directly:
select add1(x) from X;
Also, is there any concept of laziness here? All the functions will be 'strictly' applied?
map(regprocedure, anyarray, out anyarray)
regproc
, but it caused the ugly calling syntax.