fix_restore_tuple.diff

text/x-diff

Filename: fix_restore_tuple.diff
Type: text/x-diff
Part: 0
Message: Re: [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
File+
src/backend/commands/repack.c 1 1
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index e2600a8888d..3c07e44d649 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -2736,7 +2736,7 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 			varlensz = VARSIZE_ANY(&chunk_header);
 
 			value = palloc(varlensz);
-			SET_VARSIZE(value, VARSIZE_ANY(&chunk_header));
+			memcpy(value, &chunk_header, VARHDRSZ);
 			BufFileReadExact(file, (char *) value + VARHDRSZ, varlensz - VARHDRSZ);
 
 			slot->tts_values[i] = PointerGetDatum(value);