>From 4021282c6504137ba40407ecb31502d789bd1000 Mon Sep 17 00:00:00 2001
From: Tomas Vondra <tv@fuzzy.cz>
Date: Wed, 7 Jan 2015 18:18:51 +0100
Subject: [PATCH 3/3] fix hashcontext -> aggcontext in agg node

---
 src/backend/executor/nodeAgg.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/backend/executor/nodeAgg.c b/src/backend/executor/nodeAgg.c
index 3b9f4cc..d7cd899 100644
--- a/src/backend/executor/nodeAgg.c
+++ b/src/backend/executor/nodeAgg.c
@@ -997,7 +997,7 @@ build_hash_table(AggState *aggstate, long nbuckets)
 											  tmpmem);
 
 	aggstate->hash_mem_min = MemoryContextMemAllocated(
-		aggstate->hashcontext, true);
+		aggstate->aggcontext, true);
 
 	if (aggstate->hash_mem_min > aggstate->hash_mem_peak)
 		aggstate->hash_mem_peak = aggstate->hash_mem_min;
@@ -1108,7 +1108,7 @@ lookup_hash_entry(AggState *aggstate, HashWork *work,
 		hashslot->tts_isnull[varNumber] = inputslot->tts_isnull[varNumber];
 	}
 
-	hash_mem = MemoryContextMemAllocated(aggstate->hashcontext, true);
+	hash_mem = MemoryContextMemAllocated(aggstate->aggcontext, true);
 	if (hash_mem > aggstate->hash_mem_peak)
 		aggstate->hash_mem_peak = hash_mem;
 
-- 
2.0.5

