Re: Improper use about DatumGetInt32

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>, Ashutosh Bapat <ashutosh(dot)bapat(at)2ndquadrant(dot)com>, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, "Hou, Zhijie" <houzj(dot)fnst(at)cn(dot)fujitsu(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Improper use about DatumGetInt32
Date: 2021-01-09 12:41:39
Message-ID: e6330583-4276-8742-1f8a-9f5464f97f8a@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2021-01-09 02:46, Michael Paquier wrote:
> +/* LCOV_EXCL_START */
> Does it really make sense to add those markers here? It seems to me
> that we would ignore any new coverage if regression tests based on
> older versions are added (we may really want to have such tests for
> more in-core extensions to be able to verify the portability of an
> extension, but that's not the job of this patch of course).

If we had a way to do such testing then we wouldn't need these markers.
But AFAICT, we don't.

> - elog(ERROR, "block 0 is a meta page");
> + ereport(ERROR,
> + (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
> + errmsg("block 0 is a meta page")));
> [...]
> + errmsg("block number %llu is out of range for relation \"%s\"",
> This does not follow the usual style for error reports that should not
> be written as full sentences? Maybe something like "invalid block
> number %u referring to meta page" and "block number out of range for
> relation %s: %llu"?

There are many error messages that say "[something] is out of range". I
don't think banning that would serve any purpose.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message youichi aramaki 2021-01-09 13:44:03 Re: Add table access method as an option to pgbench
Previous Message Amit Kapila 2021-01-09 12:40:43 Re: [HACKERS] logical decoding of two-phase transactions