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, I don't think > there is an easy way to do this automatically with say a polymorphic > aggregate. You need to know that there is a related type interval that > can be used to keep track of differences in timestamps and that can be > added back to a timestamp at the end. Given that this would be done with C code, I doubt we'd go to the trouble of implementing it that way. We'd just cheat: add up the numeric values of the timestamps and divide at the end. float8 makes a perfectly fine accumulator ;-) regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])