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

Поиск
Список
Период
Сортировка
От Pedro Gimeno
Тема [BUGS] Re: BUG #14632: Plus and minus operators inconsistency with leapyears and year intervals.
Дата
Msg-id 59031D98.5010008@personal.formauri.es
обсуждение исходный текст
Ответ на Re: [BUGS] BUG #14632: Plus and minus operators inconsistency with leap years and year intervals.  (Pietro Pugni <pietro.pugni@gmail.com>)
Список pgsql-bugs
Pietro Pugni wrote, On 2017-04-28 10:28:

> I’m aware that 2. and 4. can’t return different result because they are the same queries, but in that cases the
resultcorrectness depends on the context.
 

You can use 10*interval '31556952 seconds' to add or subtract 10 years with consistent results. 31556952 seconds is the
averagelength of the year in the Gregorian calendar. To use this approach, you need to start using timestamp instead of
date,and avoid using timestamp with time zone on a time zone that uses daylight savings.
 

I don't think PostgreSQL needs to do anything about this issue.


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

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

Предыдущее
От: Pietro Pugni
Дата:
Сообщение: Re: [BUGS] BUG #14632: Plus and minus operators inconsistency with leap years and year intervals.
Следующее
От: Huong Dangminh
Дата:
Сообщение: [BUGS] typo in 9.6 release-note