Excerpts from Stephen Frost's message of vie ene 07 15:29:52 -0300 2011: > * Stephen Frost (sfr...@snowman.net) wrote: > > * Robert Haas (robertmh...@gmail.com) wrote: > > > > Making it part of DISCARD PLANS; and back-patching it to 8.3 where > > > > DISCARD was introduced would be awesome for me. :) > > > > > > I'd need to look at this more closely before committing anything, but > > > at first blush I think that's reasonable. Have a patch? > > > > To be honest, I was fully expecting a response of "that's hard to do." > > Soo, yeah, I found the "this is hard" part. Basically, the plan > cacheing, etc, is all handled by the stored procedures themselves, and > we havn't got any way to tell a PL "destroy all your plans." We might > be able to hack up fmgr to throw away all references to functions, but > that wouldn't release the memory they use up, making 'discard plans;' > leak like a sieve.
What this discussion suggests to me is that cached plans need to be tracked by a resource owner that's linked to the function. The problem I see with this idea is figure out what module would keep track of resowners that need to be reset ... Other than that I think it should be straightforward :-) -- Álvaro Herrera <alvhe...@commandprompt.com> The PostgreSQL Company - Command Prompt, Inc. PostgreSQL Replication, Consulting, Custom Development, 24x7 support -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers