*** src/backend/catalog/heap.c
--- src/backend/catalog/heap.c
***************
*** 2257,2262 **** RelationTruncateIndexes(Relation heapRelation)
--- 2257,2263 ----
  		Oid			indexId = lfirst_oid(indlist);
  		Relation	currentIndex;
  		IndexInfo  *indexInfo;
+ 		ForkNumber forknum;
  
  		/* Open the index relation; use exclusive lock, just to be sure */
  		currentIndex = index_open(indexId, AccessExclusiveLock);
***************
*** 2265,2275 **** RelationTruncateIndexes(Relation heapRelation)
  		indexInfo = BuildIndexInfo(currentIndex);
  
  		/*
! 		 * Now truncate the actual file (and discard buffers). The indexam
! 		 * is responsible for truncating the FSM in index_build(), if
! 		 * applicable.
  		 */
  		RelationTruncate(currentIndex, 0);
  
  		/* Initialize the index and rebuild */
  		/* Note: we do not need to re-establish pkey setting */
--- 2266,2280 ----
  		indexInfo = BuildIndexInfo(currentIndex);
  
  		/*
! 		 * Now truncate the actual file (and discard buffers), and drop any
! 		 * additional forks. This leaves us in the same state as after
! 		 * heap_create().
  		 */
  		RelationTruncate(currentIndex, 0);
+ 		for (forknum = 0; forknum <= MAX_FORKNUM; forknum++)
+ 			if (smgrexists(currentIndex->rd_smgr, forknum))
+ 				smgrdounlink(currentIndex->rd_smgr, forknum,
+ 							 currentIndex->rd_istemp, false);
  
  		/* Initialize the index and rebuild */
  		/* Note: we do not need to re-establish pkey setting */
*** src/backend/storage/freespace/indexfsm.c
--- src/backend/storage/freespace/indexfsm.c
***************
*** 38,47 **** InitIndexFreeSpaceMap(Relation rel)
  {
  	/* Create FSM fork if it doesn't exist yet, or truncate it if it does */
  	RelationOpenSmgr(rel);
! 	if (!smgrexists(rel->rd_smgr, FSM_FORKNUM))
! 		smgrcreate(rel->rd_smgr, FSM_FORKNUM, rel->rd_istemp, false);
! 	else
! 		smgrtruncate(rel->rd_smgr, FSM_FORKNUM, 0, rel->rd_istemp);
  }
  
  /*
--- 38,44 ----
  {
  	/* Create FSM fork if it doesn't exist yet, or truncate it if it does */
  	RelationOpenSmgr(rel);
! 	smgrcreate(rel->rd_smgr, FSM_FORKNUM, rel->rd_istemp, false);
  }
  
  /*
