Re: pg_plan_advice: fix parsing underscore in numbers

From: Lukas Fittl <lukas(at)fittl(dot)com>
To: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
Cc: Daniel Gustafsson <daniel(at)yesql(dot)se>, PostgreSQL-development <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: pg_plan_advice: fix parsing underscore in numbers
Date: 2026-07-18 01:04:22
Message-ID: CAP53PkyVHEhsUny7XSX+xHCu7jmv9uuxGZtd1DYRDN3=+qG_Ew@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jul 17, 2026 at 1:59 PM Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> wrote:
>
>
>
> > On Jul 17, 2026, at 18:16, Daniel Gustafsson <daniel(at)yesql(dot)se> wrote:
> >
> >
> >> The attached patch fixes this by using pg_strtoint32_safe() in the same way as the core scanner.
> >

FWIW, I've raised this issue at the time during patch review, and
Robert noted "OK" at the time, but I assume this was forgotten in the
final committed version. Excerpt from that thread:

On Mon, Mar 16, 2026 at 1:51 PM Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>
> On Fri, Mar 13, 2026 at 4:39 AM Lukas Fittl <lukas(at)fittl(dot)com> wrote:
> > - pgpa_scanner accepts integers with underscores, but incorrectly uses
> > a simple strtoint on them (which would fail), instead of pg_strtoint32
> > / pg_strtoint32_safe
>
> OK.

See https://www.postgresql.org/message-id/flat/CA%2BTgmoYMpO%3D%2BEQwDhMoH%3DzmTGbB6TD5-_9bciNEoDArP8JjSMw%40mail.gmail.com#799bd1f5bbfd0fc8492001a8752eb5b5

> PFA v3, which only adds this test case.

I think v3 looks good from a quick look.

Thanks,
Lukas

--
Lukas Fittl

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2026-07-18 02:19:20 Re: Fix duplicate detection for null-treatment window functions
Previous Message Michael Paquier 2026-07-18 00:47:43 Re: Unexpected behavior after OOM errors