Gerhard Wiesinger <lists(at)wiesinger(dot)com> writes:
> On Mon, 19 Oct 2009, Tom Lane wrote:
>> Probably because you have the function declared VOLATILE.
> None of the function is declared VOLATILE. Any other idea?
[ shrug... ] There are other possible reasons why the planner would
fail to flatten a subquery, but none of them apply to the example you
showed. And your example function *was* VOLATILE, by default.
regards, tom lane