Inconsistent behavior with AGE() - Mailing list pgsql-bugs

From Josh Berkus
Subject Inconsistent behavior with AGE()
Date
Msg-id 200410281356.25970.josh@agliodbs.com
Whole thread Raw
Responses Re: Inconsistent behavior with AGE()  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
Folks,

Pardon me if this is redundant, but again the pgsql-bugs archives are not
working.

Summary:  Various versions of AGE() give inconsistent results
Versions Tested: 7.4.2, 7.4.3, 8.0b4
Severity:  Annoyance
Description:  The age() built-in function sometimes truncates hours, minutes
and seconds, and sometimes it doesn't, depending on the parameters.   This
seems inconsistent and confusing.

gforge=> select age('2004-01-01'::TIMESTAMP);
      age
----------------
 9 mons 27 days
(1 row)

gforge=> select age(now(),'2004-01-01'::TIMESTAMP);
                age
------------------------------------
 9 mons 27 days 11:17:19.8895479999
(1 row)

--
--Josh

Josh Berkus
Aglio Database Solutions
San Francisco

pgsql-bugs by date:

Previous
From: Kris Jurka
Date:
Subject: Re: PREPARE(d) statements and modifying columns
Next
From: Tom Lane
Date:
Subject: Re: Inconsistent behavior with AGE()