avg() for timestamp

From: Neil Conway <neilc(at)samurai(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: avg() for timestamp
Date: 2004-03-07 02:50:52
Message-ID: 404A8E0C.6080609@samurai.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-03-07 03:46:57 Re: Feature request: smarter use of conditional indexes
Previous Message Larry Rosenman 2004-03-07 02:39:38 Re: Feature request: smarter use of conditional indexes