Re: confusing message in check_tuple

Peter Eisentraut <peter@eisentraut.org>

From: Peter Eisentraut <peter@eisentraut.org>
To: jian he <jian.universality@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2025-06-17T05:21:13Z
Lists: pgsql-hackers
On 12.06.25 08:26, jian he wrote:
> in contrib/amcheck/verify_heapam.c, check_tuple
>          report_corruption(ctx,
>                            psprintf("number of attributes %u exceeds
> maximum expected for table %u",
>                                     ctx->natts,
>                                     RelationGetDescr(ctx->rel)->natts));

Agreed this is misleading.

> i think it should be
>          report_corruption(ctx,
>                            psprintf("number of attributes %u exceeds
> maximum expected for table %u",
>                                     ctx->natts,
>                                     RelationGetRelid(ctx->rel)));
> 
> or we can rephrase it another way, also mentioning
> ``RelationGetDescr(ctx->rel)->natts``.

I think they did want to mention RelationGetDescr(ctx->rel)->natts.  How 
about

"number of attributes %u exceeds maximum expected for table (%u)"




Commits

  1. amcheck: Improve confusing message