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