Skip to content

Commit 9530502

Browse files
committed
amcheck: Improve confusing message
The way it was worded, the %u placeholder could be read as the table OID. Rearrange slightly to avoid the possible confusion. Reported-by: jian he <jian.universality@gmail.com> Reviewed-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/CACJufxFx-25XQV%2Br23oku7ZnL958P30hyb9cFeYPv6wv7yzCCw%40mail.gmail.com
1 parent 7fe2f67 commit 9530502

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

contrib/amcheck/verify_heapam.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1942,7 +1942,7 @@ check_tuple(HeapCheckContext *ctx, bool *xmin_commit_status_ok,
19421942
if (RelationGetDescr(ctx->rel)->natts < ctx->natts)
19431943
{
19441944
report_corruption(ctx,
1945-
psprintf("number of attributes %u exceeds maximum expected for table %u",
1945+
psprintf("number of attributes %u exceeds maximum %u expected for table",
19461946
ctx->natts,
19471947
RelationGetDescr(ctx->rel)->natts));
19481948
return;

src/bin/pg_amcheck/t/004_verify_heapam.pl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ sub header
529529
$tup->{t_infomask2} |= HEAP_NATTS_MASK;
530530

531531
push @expected,
532-
qr/${$header}number of attributes 2047 exceeds maximum expected for table 3/;
532+
qr/${$header}number of attributes 2047 exceeds maximum 3 expected for table/;
533533
}
534534
elsif ($offnum == 10)
535535
{
@@ -552,7 +552,7 @@ sub header
552552
$tup->{t_hoff} = 32;
553553

554554
push @expected,
555-
qr/${$header}number of attributes 67 exceeds maximum expected for table 3/;
555+
qr/${$header}number of attributes 67 exceeds maximum 3 expected for table/;
556556
}
557557
elsif ($offnum == 12)
558558
{

0 commit comments

Comments
 (0)