Re: Non-decimal integer literals

From: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
To: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, David Rowley <dgrowleyml(at)gmail(dot)com>, John Naylor <john(dot)naylor(at)enterprisedb(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Non-decimal integer literals
Date: 2023-01-24 10:34:19
Message-ID: CAEudQAp7u7q=WBxhcEvpZt67LaHWMKNGL57FP3DoG84uT0embw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Em ter., 24 de jan. de 2023 às 07:24, Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
escreveu:

> On Tue, 24 Jan 2023 at 00:47, Ranier Vilela <ranier(dot)vf(at)gmail(dot)com> wrote:
> >
> > On 13.01.23 11:01, Dean Rasheed wrote:
> > > So I'm feeling quite good about the end result -- I set out hoping not
> > > to make performance noticeably worse, but ended up making it
> > > significantly better.
> > Hi Dean, thanks for your work.
> >
> > But since PG_RETURN_NULL, is a simple return,
> > now the "value" var is not leaked?
> >
>
> That originates from a prior commit:
>
> ccff2d20ed Convert a few datatype input functions to use "soft" error
> reporting.
>
> and see also a bunch of follow-on commits for other input functions.
>
> It will only return NULL if the input is invalid and escontext is
> non-NULL. You only identified a fraction of the cases where that would
> happen. If we really cared about not leaking memory for invalid
> inputs, we'd have to look at every code path using ereturn()
> (including lower-level functions, and not just in numeric.c). I think
> that would be a waste of time, and counterproductive -- trying to
> immediately free memory for all possible invalid inputs would likely
> complicate a lot of code, and slow down parsing of valid inputs.
> Better to leave it until the owning memory context is freed.
>
Thank you for the explanation.

regards,
Ranier Vilela

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Borisov 2023-01-24 10:35:21 Re: old_snapshot_threshold bottleneck on replica
Previous Message Dean Rasheed 2023-01-24 10:24:09 Re: Non-decimal integer literals