Re: Absolute value of intervals

Поиск
Список
Период
Сортировка
От Jeff Davis
Тема Re: Absolute value of intervals
Дата
Msg-id 1256863399.10769.235.camel@monkey-cat.sm.truviso.com
обсуждение исходный текст
Ответ на Re: Absolute value of intervals  (Scott Bailey <artacus@comcast.net>)
Ответы Re: Absolute value of intervals
Re: Absolute value of intervals
Список pgsql-general
On Thu, 2009-10-29 at 16:39 -0700, Scott Bailey wrote:
> But there is some ambiguity around the length of a month. So INTERVAL '1
> month - 30 days' =  INTERVAL '0 days' = INTERVAL '-1 month +30 days'.
> But when added to a date, it makes no change for months with 30 days,
> adds 1 day for months with 31 days and subtracts 2 days for February.

Yes, that is a strange case. When you can't tell if an interval is
positive or negative, how do you define the absolute value?

I think that's a strong argument not to provide an absolute value
function for INTERVALs.

Regards,
    Jeff Davis


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

Предыдущее
От: Scott Bailey
Дата:
Сообщение: Re: Absolute value of intervals
Следующее
От: Greg Smith
Дата:
Сообщение: Re: checkpoints/bgwriter tuning verification