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

From Dean Rasheed
Subject Re: Numeric multiplication overflow errors
Date
Msg-id CAEZATCVz9DG7mDfGP66G4hkWKUjwW-W0VMyuMLB99fPsSubDxg@mail.gmail.com
Whole thread Raw
In response to Re: Numeric multiplication overflow errors  (Ranier Vilela <ranier.vf@gmail.com>)
Responses Re: Numeric multiplication overflow errors  (Ranier Vilela <ranier.vf@gmail.com>)
List pgsql-hackers
On Fri, 2 Jul 2021 at 19:48, Ranier Vilela <ranier.vf@gmail.com> wrote:
>
> If you allow me a small suggestion.
> Move the initializations of the variable tmp_var to after check if the function can run.
> Saves some cycles, when not running.
>

OK, thanks. I agree, on grounds of neatness and consistency with
nearby code, so I've done it that way.

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.

Regards,
Dean



pgsql-hackers by date:

Previous
From: Yugo NAGATA
Date:
Subject: Re: [HACKERS] WIP aPatch: Pgbench Serialization and deadlock errors
Next
From: Amit Kapila
Date:
Subject: Re: Skipping logical replication transactions on subscriber side