Re: BUG #19340: Wrong result from CORR() function

From: Oleg Ivanov <o15611(at)gmail(dot)com>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19340: Wrong result from CORR() function
Date: 2025-12-02 14:05:23
Message-ID: CAH1GMznwE=WGJYCZU1ou9iOmNR87NQFSRdYHqE3=JQ3as4P1hQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Yes, must be NULL in all the queries I have provided!
But PostgreSQL curr() returns numbers, wich is incorrect.

On Tue, Dec 2, 2025 at 2:30 PM Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
wrote:

> On Tue, 2025-12-02 at 07:57 +0000, PG Bug reporting form wrote:
> > The following bug has been logged on the website:
> >
> > Bug reference: 19340
> > Logged by: Oleg Ivanov
> > Email address: o15611(at)gmail(dot)com
> > PostgreSQL version: 18.1
> > Operating system: all
> > Description:
> >
> > postgres=# SELECT corr( 0.09 , 0.09000001 ) FROM generate_series(1,24) ;
> > corr
> > ------
> >
> > (1 row)
> >
> > If argument is the constant, function CORR() must give a 0 or NaN.
> > Consequences of this bug: statistic functions are used to make business
> > descision. Wrong and completely different results can lead to make
> mistakes.
>
> The documentation is pretty clear about that:
>
> In all cases, null is returned if the computation is meaningless, for
> example when N is zero.
>
> Yours,
> Laurenz Albe
>

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Laurenz Albe 2025-12-02 16:24:54 Re: BUG #19341: REPLACE() fails to match final character when using nondeterministic ICU collation
Previous Message Daniel Gustafsson 2025-12-02 13:36:27 Re: BUG #19342: ERROR: function gcd(smallint, smallint) is not unique