Re: [PATCH] Fix overflow and underflow in regr_r2()

From: Chengpeng Yan <chengpeng_yan(at)outlook(dot)com>
To: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Fix overflow and underflow in regr_r2()
Date: 2026-05-23 02:42:37
Message-ID: 10B9314B-B6F2-4657-94BC-C990F918CE44@outlook.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

> On May 17, 2026, at 17:16, Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com> wrote:
>
> OK, here's a more complete patch along those lines, intended to apply
> on top of the regr_r2() patch.

Thanks for the regr_intercept.patch. The approach looks good to me.

I only noticed a few small things:

1. The patch file seems to have a format issue and doesn't apply
directly. `git apply` reports:

```
error: git apply: bad git-diff - expected /dev/null on line 2
```

2. `dy` seems a bit hard to understand. Perhaps `offset`, as used in the
earlier sketch, would be clearer?

3. Do we need to add tests for the underflow path, and perhaps for the
Inf/NaN guard?

Other than that, this looks good to me.

--
Best regards,
Chengpeng Yan

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Shinya Kato 2026-05-23 05:22:48 Re: Report oldest xmin source when autovacuum cannot remove tuples
Previous Message Fujii Masao 2026-05-23 01:58:40 Re: postgres_fdw: use_scram_passthrough on user mapping is ignored when also set on server