Re: BUG #13619: regression functions return Null

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: biswadeep(dot)banerjee(at)actifio(dot)com
Cc: "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #13619: regression functions return Null
Date: 2015-09-14 16:53:08
Message-ID: CAKFQuwaeo0o0e4UeHEbVgbv-iOwgsaj=aaXAHpKQc6vgZ_e_sQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-general

On Mon, Sep 14, 2015 at 6:14 AM, <biswadeep(dot)banerjee(at)actifio(dot)com> wrote:

> The following bug has been logged on the website:
>
> Bug reference: 13619
> Logged by: Biswadeep Banerjee
> Email address: biswadeep(dot)banerjee(at)actifio(dot)com
> PostgreSQL version: 9.4.4
> Operating system: Any
> Description:
>
> Hi,
> Trending analysis is one of our use case, where I am trying the use the
> regression function in postgres 9.4.4.
> eg. regr_slope(y,x); regr_intercept(y,x).
>
> I have tried to use the functions to fit in our trending analysis SQL but
> returns NULL.
> As test also tried with constant values, like,
> select regr_slope(4,3), regr_intercept(4,3) from table;
>
> --- returns NULL.
>
> Is this a known issue? or I am using the function differently.
>

​These are "aggregate" functions and you need to use them in a query that
contains a "GROUP BY".

Think about it this way - what is the slope and intercept of a single
point? That is basically what you are asking when you write
"regr_slope(4,3)"

David J.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2015-09-14 19:03:06 Re: BUG #13619: regression functions return Null
Previous Message Tom Lane 2015-09-14 13:41:15 Re: BUG #13618: terminated by exception 0xC0000005

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2015-09-14 16:59:31 Re: issue, dumping and restoring tables with table inheritance can alter column order
Previous Message Ingmar Brouns 2015-09-14 15:11:52 issue, dumping and restoring tables with table inheritance can alter column order