diff --git a/contrib/amcheck/verify_heapam.c b/contrib/amcheck/verify_heapam.c index c875f3e5a2..e488f5e234 100644 --- a/contrib/amcheck/verify_heapam.c +++ b/contrib/amcheck/verify_heapam.c @@ -1385,19 +1385,11 @@ check_tuple_attribute(HeapCheckContext *ctx) toast_pointer.va_rawsize, VARLENA_SIZE_LIMIT)); - if (VARATT_IS_COMPRESSED(&toast_pointer)) + if (VARATT_EXTERNAL_IS_COMPRESSED(toast_pointer)) { ToastCompressionId cmid; bool valid = false; - /* Compression should never expand the attribute */ - if (VARATT_EXTERNAL_GET_EXTSIZE(toast_pointer) > toast_pointer.va_rawsize - VARHDRSZ) - report_corruption(ctx, - psprintf("toast value %u external size %u exceeds maximum expected for rawsize %d", - toast_pointer.va_valueid, - VARATT_EXTERNAL_GET_EXTSIZE(toast_pointer), - toast_pointer.va_rawsize)); - /* Compressed attributes should have a valid compression method */ cmid = TOAST_COMPRESS_METHOD(&toast_pointer); switch (cmid)