On 2005-04-28, "J.Simon Goodall" <simon@EstanciaViamonte.com> wrote:
>
> The following bug has been logged online:
>
> Bug reference: 1637
> Logged by: J.Simon Goodall
> Email address: simon@EstanciaViamonte.com
> PostgreSQL version: 7.4.2
> Operating system: Linux
> Description: age() function is giving different results
> Details:
>
> With the same query the age function is giving me two results, one as it
> should be (34 years) and the other one is off by 1 hour, the query is a
> single one so the results I asume should be the same.
>
> I have tried finding the age(,) function in the source but had no luck.
I did some analysis for this one when it was mentioned just now in the irc
chan. I can reproduce on 7.4.x as follows:
test=> set timezone to 'America/Buenos_Aires';
SET
test=> select age(date '2005-05-05', date '1964-05-05');
age
-----------------------------------
40 years 11 mons 30 days 23:00:00
(1 row)
Doesn't occur with any other timezones I tried, also doesn't occur if
you explicitly cast the dates to timestamp (not timestamptz) which
causes the other version of age() to be used instead. So this is obviously
a timezone-related issue. Couldn't reproduce on 8.0.1 with any timezone.
--
Andrew, Supernews
http://www.supernews.com - individual and corporate NNTP services