Re: Numeric multiplication overflow errors - Mailing list pgsql-hackers

From Ranier Vilela
Subject Re: Numeric multiplication overflow errors
Date
Msg-id CAEudQApM3vKWg+ut2PQiYCn_s1au34Sdqo17+tm=zHEvBEm=SA@mail.gmail.com
Whole thread Raw
In response to Re: Numeric multiplication overflow errors  (David Rowley <dgrowleyml@gmail.com>)
List pgsql-hackers
Em seg., 5 de jul. de 2021 às 09:02, David Rowley <dgrowleyml@gmail.com> escreveu:
On Mon, 5 Jul 2021 at 23:07, Ranier Vilela <ranier.vf@gmail.com> wrote:
>
> Em seg., 5 de jul. de 2021 às 06:44, Dean Rasheed <dean.a.rasheed@gmail.com> escreveu:
>> Note, however, that it won't make any difference to performance in the
>> way that you're suggesting -- elog() in Postgres is used for "should
>> never happen, unless there's a software bug" errors, rather than, say,
>> "might happen for certain invalid inputs" errors, so init_var() should
>> always be called in these functions.
>
> I agree that in this case, most of the time, elog is not called.

You may have misunderstood what Dean meant.  elog(ERROR) calls are now
exclusively for "cannot happen" cases.  If someone gets one of these
then there's a bug to fix or something else serious has gone wrong
with the hardware.

The case you seem to be talking about would fit better if the code in
question had been ereport(ERROR).

I don't disagree that the initialisation is better to happen after the
elog. I'm just mentioning this as I wanted to make sure you knew the
difference between elog(ERROR) and ereport(ERROR).
I understand the difference now, thanks for clarifying.

regards,
Ranier Vilela

pgsql-hackers by date:

Previous
From: Ronan Dunklau
Date:
Subject: Re: Add proper planner support for ORDER BY / DISTINCT aggregates
Next
From: Ranier Vilela
Date:
Subject: Fix possible variable declaration uninitialized (src/backend/utils/adt/varlena.c)