From 57056b1ca511ef549ee3f28a8e17d2bdfbf757a5 Mon Sep 17 00:00:00 2001 From: amit Date: Tue, 10 Apr 2018 15:38:19 +0900 Subject: [PATCH v1] Fix a memory context bug in RelationBuildPartitionKey We should pass rd_partkeycxt to set fn_mcxt, not CurrentMemoryContex. --- src/backend/utils/cache/relcache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c index e81c4691ec..2a74601fc1 100644 --- a/src/backend/utils/cache/relcache.c +++ b/src/backend/utils/cache/relcache.c @@ -1034,7 +1034,7 @@ RelationBuildPartitionKey(Relation relation) procnum, format_type_be(opclassform->opcintype)))); - fmgr_info(funcid, &key->partsupfunc[i]); + fmgr_info_cxt(funcid, &key->partsupfunc[i], partkeycxt); /* Collation */ key->partcollation[i] = collation->values[i]; -- 2.11.0