Re: Bug #443: Problem with time functions. - Mailing list pgsql-bugs

From Thomas Lockhart
Subject Re: Bug #443: Problem with time functions.
Date
Msg-id 3B9E2872.158D9E85@fourpalms.org
Whole thread Raw
In response to Bug #443: Problem with time functions.  (pgsql-bugs@postgresql.org)
Responses Re: Bug #443: Problem with time functions.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
> timetest=# select  sum(timeend-timebegin) as totaltime from timetest;
> ERROR:  Unable to select an aggregate function sum(time)

Hmm. The underlying math works:

lockhart=# select time '10:01' - time '10:00';
----------
 00:01:00

lockhart=# select sum(time '10:01' - time '10:00');
ERROR:  Unable to select an aggregate function sum(time)

A workaround for this last query is

lockhart=# select sum(cast(time '10:01' - time '10:00' as interval));
  sum
-------
 00:01

hth

OK. Bruce, are you likely to be keeper of a "fix list" for this beta
cycle? This issue should be on it...

                    - Thomas

pgsql-bugs by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Bug #447: lost connection to back end
Next
From: Peter Eisentraut
Date:
Subject: Re: PostgreSQL 7.1.3 vs. gcc 2.95.4 and GNU libc 2.2.4