Gerhard Wiesinger <lists(at)wiesinger(dot)com> writes:
> On Sun, 18 Oct 2009, Tom Lane wrote:
>> The OFFSET bit is a kluge, but is needed to keep the planner from
>> flattening the subquery and undoing your work.
> Thnx Tom. It also works without the OFFSET kludge. Any ideas why?
Probably because you have the function declared VOLATILE.
regards, tom lane