Re: Statistical Lacunae in Interval type

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Statistical Lacunae in Interval type
Дата
Msg-id 24017.1089642643@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Statistical Lacunae in Interval type  (David Fetter <david@fetter.org>)
Ответы Re: Statistical Lacunae in Interval type
Список pgsql-hackers
David Fetter <david@fetter.org> writes:
> I just ran across this, and was wondering whether it's worth a
> back-patch.  The interval type has an aggregate for average (AVG), but
> not one for standard deviation (STDDEV) or variance (VARIANCE).

AFAICS, stddev/variance require the concept of multiplying two input
values together (square, and also square root, are in the formulas).
I don't know what it means to multiply two intervals --- there's no
such operator in Postgres, anyway.

You could possibly approximate the behavior you want with something
likestddev(extract(epoch from interval_col))
which mashes the intervals down to seconds.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: James William Pye
Дата:
Сообщение: Re: [subxacts] Aborting a function
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: Statistical Lacunae in Interval type