diff --git a/src/backend/access/heap/tuptoaster.c b/src/backend/access/heap/tuptoaster.c
new file mode 100644
index fdbaf38..9a63723
*** a/src/backend/access/heap/tuptoaster.c
--- b/src/backend/access/heap/tuptoaster.c
*************** toast_fetch_datum_slice(struct varlena *
*** 2085,2094 ****
  
  	result = (struct varlena *) palloc(length + VARHDRSZ);
  
! 	if (VARATT_EXTERNAL_IS_COMPRESSED(toast_pointer))
! 		SET_VARSIZE_COMPRESSED(result, length + VARHDRSZ);
! 	else
! 		SET_VARSIZE(result, length + VARHDRSZ);
  
  	if (length == 0)
  		return result;			/* Can save a lot of work at this point! */
--- 2085,2091 ----
  
  	result = (struct varlena *) palloc(length + VARHDRSZ);
  
! 	SET_VARSIZE(result, length + VARHDRSZ);
  
  	if (length == 0)
  		return result;			/* Can save a lot of work at this point! */
