0001-Fix-restore_tuple-losing-varlena-compression-flag.patch

application/octet-stream

Filename: 0001-Fix-restore_tuple-losing-varlena-compression-flag.patch
Type: application/octet-stream
Part: 0
Message: [PATCH] Compressed TOAST data corruption with REPACK CONCURRENTLY

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: unified
Series: patch 0001
File+
src/backend/commands/repack.c 4 1
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);