Re: [HACKERS] avg() for timestamp

2004-03-08 Thread Tom Lane
Bruno Wolff III <[EMAIL PROTECTED]> writes: > Neil Conway <[EMAIL PROTECTED]> wrote: >> It seems to me the following should Just Work: >> nconway=# select avg(a) from t1; >> ERROR: function avg(timestamp without time zone) does not exist > While there is a way to calculate an average timestamp,

Re: [HACKERS] avg() for timestamp

2004-03-07 Thread Bruno Wolff III
On Sat, Mar 06, 2004 at 21:50:52 -0500, Neil Conway <[EMAIL PROTECTED]> wrote: > 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()); > INS

Re: [HACKERS] avg() for timestamp

2004-03-06 Thread Tom Lane
Neil Conway <[EMAIL PROTECTED]> writes: > It seems we could add the necessary aggregate function to do this. > Seems worth doing to me. Please add it for both timestamp with/without time zone. AFAICS the same underlying code will serve for both, but you'll need separate entries in the system cat

[HACKERS] avg() for timestamp

2004-03-06 Thread Neil Conway
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 valu