Re: daterange constructor vs cast

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: daterange constructor vs cast
Дата
Msg-id 2286798.1702314253@sss.pgh.pa.us
обсуждение исходный текст
Ответ на daterange constructor vs cast  (Shvidky Andrey <andrey_shvidky@hotmail.com>)
Список pgsql-bugs
Shvidky Andrey <andrey_shvidky@hotmail.com> writes:
> Aren't these 6 results must be the same?

I think you have the wrong idea of how range constructors work.
This:

>        daterange('[20231211', '20231211]')
>        ,daterange('[20231211', '20231212)')

is not valid input really.  It happens to not fail because date_in
ignores garbage punctuation; but nothing is considering those
brackets or parens as indicating range end types.

These are the approved way to do it:

>        ,daterange('20231211', '20231211', '[]')
>        ,daterange('20231211', '20231212', '[)')

            regards, tom lane



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

Предыдущее
От: Shvidky Andrey
Дата:
Сообщение: daterange constructor vs cast
Следующее
От: Alexander Lakhin
Дата:
Сообщение: Re: BUG #18240: Undefined behaviour in cash_mul_flt8() and friends