diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index 58e3867..e6b6fea 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -2727,7 +2727,10 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 			varlensz = VARSIZE_ANY(&chunk_header);
 
 			value = palloc(varlensz);
-			SET_VARSIZE(value, VARSIZE_ANY(&chunk_header));
+			if (VARATT_IS_4B_C(&chunk_header))
+				SET_VARSIZE_COMPRESSED(value, varlensz);
+			else
+				SET_VARSIZE(value, varlensz);
 			BufFileReadExact(file, (char *) value + VARHDRSZ, varlensz - VARHDRSZ);
 
 			slot->tts_values[i] = PointerGetDatum(value);
