Skip site navigation (1) Skip section navigation (2)

Re: BUG #2093: SUM of timeintervals, no problems in 8.0.3

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Björn Sjölenius <salvium(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2093: SUM of timeintervals, no problems in 8.0.3
Date: 2005-12-05 13:42:49
Message-ID: 20051205134249.GD6049@surnet.cl (view raw or flat)
Thread:
Lists: pgsql-bugs
Björn Sjölenius wrote:

> The result I get;
>  nick |      time      
> ------+----------------
>  apa  | 1 day 69:00:00
> 
> 
> Expected result is what 8.0.3 give me;
>  nick |      time      
> ------+----------------
>  apa  | 3 days 21:00:00

Actually this is expected.  8.1 groups hours and days separately,
because there is no way to know if 1 day means 23, 24 or 25 hours (or
even a fractional number like 24.5) in the presence of a daylight-saving
switch event.  So "1 day 69 hours" is actually more correct.

There is a function to convert to the older format:

alvherre=# select justify_hours('1 day 69:00:00');
  justify_hours  
-----------------
 3 days 21:00:00
(1 fila)

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

pgsql-bugs by date

Next:From: Richard van den BergDate: 2005-12-06 13:11:12
Subject: pg_restore fails midstream
Previous:From: Kris JurkaDate: 2005-12-05 08:35:10
Subject: Re: date overflows

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group