Re: [HACKERS] Memory leak on hashed agg rescan

2008-10-16 Thread Tom Lane
Neil Conway [EMAIL PROTECTED] writes: I noticed a minor leak in the per-query context when ExecReScanAgg() is called for a hashed aggregate. During rescan, build_hash_table() is called to create a new empty hash table in the aggcontext. However, build_hash_table() also constructs the

Re: [HACKERS] Memory leak on hashed agg rescan

2008-10-16 Thread Neil Conway
On Thu, Oct 16, 2008 at 5:26 AM, Tom Lane [EMAIL PROTECTED] wrote: It would probably be cleaner to take that logic out of build_hash_table altogether, and put it in a separate function to be called by ExecInitAgg. Yeah, I considered that -- makes sense. Attached is the patch I applied to HEAD,

[HACKERS] Memory leak on hashed agg rescan

2008-10-15 Thread Neil Conway
I noticed a minor leak in the per-query context when ExecReScanAgg() is called for a hashed aggregate. During rescan, build_hash_table() is called to create a new empty hash table in the aggcontext. However, build_hash_table() also constructs the hash_needed column list in the per-query context,