summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorRobert Haas2021-03-16 19:42:20 +0000
committerRobert Haas2021-03-16 19:42:50 +0000
commit4078ce65a0f7197180a9be2c6460ea4bf909bd98 (patch)
tree16f2300ce31863129886893cdd30866f8ffc4e3a /contrib
parentc6fc50cb40285141fad401321ae21becbaea1c59 (diff)
Fix a confusing amcheck corruption message.
Don't complain about the last TOAST chunk number being different from what we expected if there are no TOAST chunks at all. In such a case, saying that the final chunk number is 0 is not really accurate, and the fact the value is missing from the TOAST table is reported separately anyway. Mark Dilger Discussion: http://postgr.es/m/AA5506CE-7D2A-42E4-A51D-358635E3722D@enterprisedb.com
Diffstat (limited to 'contrib')
-rw-r--r--contrib/amcheck/verify_heapam.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/contrib/amcheck/verify_heapam.c b/contrib/amcheck/verify_heapam.c
index 49f5ca0ef2c..e614c12a14a 100644
--- a/contrib/amcheck/verify_heapam.c
+++ b/contrib/amcheck/verify_heapam.c
@@ -1100,14 +1100,14 @@ check_tuple_attribute(HeapCheckContext *ctx)
check_toast_tuple(toasttup, ctx);
ctx->chunkno++;
}
- if (ctx->chunkno != (ctx->endchunk + 1))
- report_corruption(ctx,
- psprintf("final toast chunk number %u differs from expected value %u",
- ctx->chunkno, (ctx->endchunk + 1)));
if (!found_toasttup)
report_corruption(ctx,
psprintf("toasted value for attribute %u missing from toast table",
ctx->attnum));
+ else if (ctx->chunkno != (ctx->endchunk + 1))
+ report_corruption(ctx,
+ psprintf("final toast chunk number %u differs from expected value %u",
+ ctx->chunkno, (ctx->endchunk + 1)));
systable_endscan_ordered(toastscan);
return true;