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

From Ranier Vilela
Subject Re: Numeric multiplication overflow errors
Date
Msg-id CAEudQAoMT3_1FdWuiPkkL7M6S2ZMgGFG-SprGnkg99oJ7VhYiQ@mail.gmail.com
Whole thread Raw
In response to Numeric multiplication overflow errors  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Responses Re: Numeric multiplication overflow errors  (Dean Rasheed <dean.a.rasheed@gmail.com>)
List pgsql-hackers

On Fri, 2 Jul 2021 at 22:55, Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com> wrote:
> Here's an update with the
> last set of changes discussed.

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.

  /* Ensure we disallow calling when not in aggregate context */
  if (!AggCheckCallContext(fcinfo, NULL))
  elog(ERROR, "aggregate function called in non-aggregate context");

+ init_var(&tmp_var);
+

regards,
Ranier Vilela

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Increase value of OUTER_VAR
Next
From: Justin Pryzby
Date:
Subject: Re: pg_ls_tmpdir to show directories and shared filesets (and pg_ls_*)