diff --git a/contrib/bloom/bloom.h b/contrib/bloom/bloom.h
index 8f3881d844665b0ec1c60ca91a8b28e2574d8fd6..d5284f372536d1536abd6a4f437ffa1d4c01eb05 100644
--- a/contrib/bloom/bloom.h
+++ b/contrib/bloom/bloom.h
@@ -110,12 +110,11 @@ typedef struct BloomMetaPageData
 typedef struct BloomState
 {
 	FmgrInfo	hashFn[INDEX_MAX_KEYS];
-	BloomOptions *opts;			/* stored in rd_amcache and defined at
-								 * creation time */
+	BloomOptions opts;			/* copy of options on index's metapage */
 	int32		nColumns;
 
 	/*
-	 * sizeOfBloomTuple is index's specific, and it depends on reloptions, so
+	 * sizeOfBloomTuple is index-specific, and it depends on reloptions, so
 	 * precompute it
 	 */
 	Size		sizeOfBloomTuple;
diff --git a/contrib/bloom/blscan.c b/contrib/bloom/blscan.c
index 6e3cb84bb11d09935bba41c733221c3282f37fdc..ba13783549424b5947e9618d9e5c1fbf6bd60783 100644
--- a/contrib/bloom/blscan.c
+++ b/contrib/bloom/blscan.c
@@ -99,7 +99,7 @@ blgetbitmap(IndexScanDesc scan, TIDBitmap *tbm)
 		/* New search: have to calculate search signature */
 		ScanKey		skey = scan->keyData;
 
-		so->sign = palloc0(sizeof(SignType) * so->state.opts->bloomLength);
+		so->sign = palloc0(sizeof(SignType) * so->state.opts.bloomLength);
 
 		for (i = 0; i < scan->numberOfKeys; i++)
 		{
@@ -151,7 +151,7 @@ blgetbitmap(IndexScanDesc scan, TIDBitmap *tbm)
 				bool		res = true;
 
 				/* Check index signature with scan signature */
-				for (i = 0; i < so->state.opts->bloomLength; i++)
+				for (i = 0; i < so->state.opts.bloomLength; i++)
 				{
 					if ((itup->sign[i] & so->sign[i]) != so->sign[i])
 					{
diff --git a/contrib/bloom/blutils.c b/contrib/bloom/blutils.c
index 92ab85811b842ba53118232e99dd00a3b07cc549..be056c33ba08b3fd451d6e843cda108660daa52a 100644
--- a/contrib/bloom/blutils.c
+++ b/contrib/bloom/blutils.c
@@ -155,9 +155,9 @@ initBloomState(BloomState *state, Relation index)
 		index->rd_amcache = (void *) opts;
 	}
 
-	state->opts = (BloomOptions *) index->rd_amcache;
+	memcpy(&state->opts, index->rd_amcache, sizeof(state->opts));
 	state->sizeOfBloomTuple = BLOOMTUPLEHDRSZ +
-		sizeof(SignType) * state->opts->bloomLength;
+		sizeof(SignType) * state->opts.bloomLength;
 }
 
 /*
@@ -228,10 +228,10 @@ signValue(BloomState *state, SignType *sign, Datum value, int attno)
 	hashVal = DatumGetInt32(FunctionCall1(&state->hashFn[attno], value));
 	mySrand(hashVal ^ myRand());
 
-	for (j = 0; j < state->opts->bitSize[attno]; j++)
+	for (j = 0; j < state->opts.bitSize[attno]; j++)
 	{
 		/* prevent mutiple evaluation */
-		nBit = myRand() % (state->opts->bloomLength * BITSIGNTYPE);
+		nBit = myRand() % (state->opts.bloomLength * BITSIGNTYPE);
 		SETBIT(sign, nBit);
 	}
 }