Re: BUG #7797: datetime + '1 month'::interval is going outside of a month's bounds

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #7797: datetime + '1 month'::interval is going outside of a month's bounds
Дата
Msg-id 13442.1357582015@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #7797: datetime + '1 month'::interval is going outside of a month's bounds  (Ryan Kelly <rpkelly22@gmail.com>)
Список pgsql-bugs
Ryan Kelly <rpkelly22@gmail.com> writes:
> On Mon, Jan 01/07/13, 2013 at 05:42:40PM +0000, Daniele Varrazzo wrote:
>> On Mon, Jan 7, 2013 at 5:19 PM, Ryan Kelly <rpkelly22@gmail.com> wrote:
>>> '1 month'::interval is the same as '30 days'::interval.

>> No, it's not.

> Alright, now I'm thoroughly confused. What magic makes this true:
> # select '30 days'::interval = '1 month'::interval;
>  ?column?
> ----------
>  t

'1 month' and '30 days' are distinct concepts.  Some operations will
treat them as equal, if there is no additional info that will nail
down the actual length of the particular month in question.  Or if
you like, 30 days is the "default" length of a month.

A related point is that the interval equality operator will say that
'24 hours' and '1 day' are equal, even though they aren't the same
thing --- there are cases where they behave differently, when working
near a DST transition time.

There might be some use for an interval "identity" operator, which would
only say true for completely-indistinguishable interval values; but we
don't have one.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #7797: datetime + '1 month'::interval is going outside of a month's bounds
Следующее
От: Rodrigo Rosenfeld Rosas
Дата:
Сообщение: wrong search_path being used