Bo Lorentsen <bl(at)netgroup(dot)dk> writes:
> But, if I, in my code, make "for loop" on a huge select result (about
> 1.7 mil. rows), my function begin to consume alot of memory.
What PG version?
We fixed quite a few transient-memory-leak problems in plpgsql in 7.2.
regards, tom lane