avg() for timestamp

Поиск
Список
Период
Сортировка
От Neil Conway
Тема avg() for timestamp
Дата
Msg-id 404A8E0C.6080609@samurai.com
обсуждение исходный текст
Ответы Re: avg() for timestamp  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: avg() for timestamp  (Bruno Wolff III <bruno@wolff.to>)
Список pgsql-hackers
It seems to me the following should Just Work:

nconway=# create table t1 (a timestamp);
CREATE TABLE
nconway=# insert into t1 values (now());
INSERT 17164 1
nconway=# insert into t1 values (now());
INSERT 17165 1
nconway=# insert into t1 values (now());
INSERT 17166 1
nconway=# insert into t1 values (now());
INSERT 17167 1
nconway=# select avg(a) from t1;
ERROR:  function avg(timestamp without time zone) does not exist
HINT:  No function matches the given name and argument types. You may 
need to add explicit type casts.

It seems we could add the necessary aggregate function to do this. 
Seems worth doing to me.

Any comments?

-Neil


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [pgsql-hackers-win32] Tablespaces
Следующее
От: Tom Lane
Дата:
Сообщение: Re: avg() for timestamp