will(dot)pearson(at)digital(dot)cabinet-office(dot)gov(dot)uk writes:
> [ lots-n-lots-of CREATE FUNCTION/execute function/DROP FUNCTION eat memory ]
I think probably what's going on here is that plpgsql is creating cache
entries for these functions on first execution, and not reclaiming them
before end of session.
I'm not terribly excited about adding overhead to make it keep track of
DROP FUNCTION operations, because this coding style seems less than great
anyway. Have you considered using DO blocks instead of short-lived
functions?
regards, tom lane