strk <strk(at)keybit(dot)net> writes:
> Why is so ? shouldn't the IMMUTABLE keywork make
> it a single call ?
No. There is no function value cache. What does happen here is that
the planner folds those calls to constants at plan time, instead of at
run time. Try
select testme(1) from some-table-with-multiple-rows
and note there's only one call not N.
regards, tom lane