Re: Fix numeric log() with an infinite value and 0<base<=1

From: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fix numeric log() with an infinite value and 0<base<=1
Date: 2026-10-16 02:39:29
Message-ID: 31D7D163-F17E-45F1-B98D-DAC8215D9E12@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On Oct 15, 2026, at 23:28, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com> writes:
>> On Thu, 15 Oct 2026 at 04:16, Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> wrote:
>>> After thinking it over, I think we can add a check for base 1 in log_var(), and numeric_log() can just defer base 1 handling to log_var(). Please see v2, which implements this approach.
>
>> LGTM.
>
> Works for me too. Pushed after a bit of comment-smithing.

Thanks a lot for pushing.

>
> I did not back-patch as you suggested, though. This behavior for
> infinite input has been there for as long as we've had numeric
> infinity, so I think the argument for changing it in stable branches
> is pretty weak.
>

Understood. Thanks for the explanation.

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/

In response to

Browse pgsql-hackers by date

  From Date Subject
Previous Message Chao Li 2026-10-16 02:34:44 Re: Avoid repeated scans of the output buffer in oidvectortypes()