Re: BUG #4878: function age() give a wrong interval

From: Frank Heikens <frankheikens(at)mac(dot)com>
To: pamelant(at)companeo(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #4878: function age() give a wrong interval
Date: 2009-06-25 09:40:51
Message-ID: D73B7F59-B09C-43BA-B836-3F403CC4366E@mac.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


select
age(
'2009-06-23 18:36:05.064066+02' ,
'2009-05-12 18:36:05.064066+02') ;

Result: "1 mon 11 days"

select justify_interval('1000 hours');

Result: "1 mon 11 days 16:00:00"

select
age(
'2009-06-23 18:36:05.064066+02' ,
'2009-05-12 18:36:05.064066+02')
> interval '1000 hours'
;

Result: false

And that's correct, 1 month and 11 days is less than 1 month, 11 days
and 16 hours, it's not more. This is the actual comparison:

select interval '1 mon 11 day' > interval '1 mon 11 day 16 hour';

I don't see a problem nor a bug.

Regards,
Frank

Op 25 jun 2009, om 11:28 heeft pamelant(at)companeo(dot)com het volgende
geschreven:

>
> The following bug has been logged online:
>
> Bug reference: 4878
> Logged by:
> Email address: pamelant(at)companeo(dot)com
> PostgreSQL version: 8.2.4, 8.3.6
> Operating system: linux
> Description: function age() give a wrong interval
> Details:
>
> age() report a wrong interval in some case
>
> example
>
> intervall between the 2 dates is 1008 hours
>
> select age('2009-06-23 18:36:05.064066+02' ,'"2009-05-12
> 18:36:05.064066
> +02"') > interval '1000 hours';
>
> result is false instead of true.
> There is a 24 hours error in the age() results
>
> regards
>
> --
> Sent via pgsql-bugs mailing list (pgsql-bugs(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-bugs

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Philippe Amelant 2009-06-25 10:50:35 Re: BUG #4878: function age() give a wrong interval
Previous Message pamelant 2009-06-25 09:28:50 BUG #4878: function age() give a wrong interval