BUG #1637: age() function is giving different results - Mailing list pgsql-bugs

From J.Simon Goodall
Subject BUG #1637: age() function is giving different results
Date
Msg-id 20050428194725.0EA00F0D21@svr2.postgresql.org
Whole thread Raw
Responses Re: BUG #1637: age() function is giving different results
List pgsql-bugs
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.

Would appreciate some help, thx.

Simon.

Z SQL Method Z SQL Method at  /StockMan/select_birthdays

Famname     Firstname     Birth date     Age
Surname1     Name1     1971-05-05     34 years
Surname2     Name2     1964-05-05     40 years 11 mons 30 days 23:00:00

SQL used:

SELECT famname, firstname, birth_date, age( DATE '2005-05-05'::date,
birth_date::date )
 FROM addresses
 WHERE
  EXTRACT ( day FROM timestamp '2005-05-05') = EXTRACT ( day FROM
birth_date)
 AND
  EXTRACT ( month FROM timestamp '2005-05-05') = EXTRACT ( month FROM
birth_date);

pgsql-bugs by date:

Previous
From: "Mike G."
Date:
Subject: Re: BUG #1635: Failed to create process for initdb
Next
From: Tom Lane
Date:
Subject: Re: BUG #1637: age() function is giving different results