Re: No stddev() for interval? - Mailing list pgsql-general

From Brendan Jurd
Subject Re: No stddev() for interval?
Date
Msg-id 37ed240d0605201427s11a72763kf1222f6f2073082f@mail.gmail.com
Whole thread Raw
In response to Re: No stddev() for interval?  (David Fetter <david@fetter.org>)
Responses Re: No stddev() for interval?  ("Nikolay Samokhvalov" <samokhvalov@gmail.com>)
List pgsql-general

That's because variance of foo is measured in foo^2 units.  What is
the square of an interval?

Cheers,
D

Well if you're willing to accept that for the purposes of computing the aggregates, an interval "month" is equal to 30 days (which is how avg(interval) already works), then an interval is reducable to a single quantity -- a number of seconds -- which can be squared.

30 days per month is pretty rough ... we could refine it to 30.4375, which is the average number of days per month over four years including one leap year.

pgsql-general by date:

Previous
From: David Fetter
Date:
Subject: Re: No stddev() for interval?
Next
From: "Nikolay Samokhvalov"
Date:
Subject: Re: No stddev() for interval?