Re: [BUGS] BUG #14632: Plus and minus operators inconsistency withleap years and year intervals.

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: [BUGS] BUG #14632: Plus and minus operators inconsistency withleap years and year intervals.
Дата
Msg-id CAKFQuwZCG0H_uXBQ1wK+_srF_cgm9jALE6PvkmAPWs1TtZgeOA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [BUGS] BUG #14632: Plus and minus operators inconsistency with leap years and year intervals.  (Pietro Pugni <pietro.pugni@gmail.com>)
Ответы Re: [BUGS] BUG #14632: Plus and minus operators inconsistency with leap years and year intervals.  (Pietro Pugni <pietro.pugni@gmail.com>)
Список pgsql-bugs
On Wed, Apr 26, 2017 at 3:44 PM, Pietro Pugni <pietro.pugni@gmail.com> wrote:
This is inconsistent (and wrong) against the result provided by this query:
select age('1922-02-28'::date, '1912-02-29'::date)
           age           
-------------------------
 9 years 11 mons 28 days

I expect it to return ’10 years’ instead.

I don't know if you intended to supersize your response but it ended up that way in my mail client.

I'll agree that the age function has enough data available to it to return 10 years in this case.

28 days, target month is February in a non-leap-year (1922), convert to 1 month.  11 months + 1 month = 12 months = 1 year.  9 years + 1 year = 10 years.

But the provided answer is correct as well...

David J.

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Pietro Pugni
Дата:
Сообщение: Re: [BUGS] BUG #14632: Plus and minus operators inconsistency with leap years and year intervals.
Следующее
От: Marko Tiikkaja
Дата:
Сообщение: Re: [BUGS] BUG #14632: Plus and minus operators inconsistency withleap years and year intervals.