BUG #1637: age() function is giving different results

Поиск
Список
Период
Сортировка
От J.Simon Goodall
Тема BUG #1637: age() function is giving different results
Дата
Msg-id 20050428194725.0EA00F0D21@svr2.postgresql.org
обсуждение исходный текст
Ответы Re: BUG #1637: age() function is giving different results  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: "Mike G."
Дата:
Сообщение: Re: BUG #1635: Failed to create process for initdb
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #1637: age() function is giving different results