Re: No stddev() for interval?

From: "Brendan Jurd" <direvus(at)gmail(dot)com>
To: "David Fetter" <david(at)fetter(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: No stddev() for interval?
Date: 2006-05-20 21:27:46
Message-ID: 37ed240d0605201427s11a72763kf1222f6f2073082f@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Nikolay Samokhvalov 2006-05-20 21:37:21 Re: No stddev() for interval?
Previous Message David Fetter 2006-05-20 20:28:28 Re: No stddev() for interval?