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

From Nikolay Samokhvalov
Subject Re: No stddev() for interval?
Date
Msg-id e431ff4c0605201521t7fa65934t53e1e6025739d76c@mail.gmail.com
Whole thread Raw
In response to Re: No stddev() for interval?  ("Brendan Jurd" <direvus@gmail.com>)
Responses Re: No stddev() for interval?  ("Ivan Zolotukhin" <ivan.zolotukhin@gmail.com>)
List pgsql-general
On 5/21/06, Brendan Jurd <direvus@gmail.com> wrote:
>
> 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.
>

Let me make a correction. Internally, intervals are stored as separate
values of months and days (and even seconds, for daylight saving
purposes). So, in almost all cases everything is OK. But it isn't so
when we should multiply or devide such 'hetorogenious intevals'
("select interval '1 month 1 day';" gives us '15 days 12:00:00')...


--
Best regards,
Nikolay

pgsql-general by date:

Previous
From: Bob Pawley
Date:
Subject: Read Write
Next
From: "Ivan Zolotukhin"
Date:
Subject: Re: No stddev() for interval?