Re: A better BETWEEN for DATEs, TIMEs and TIMESTAMPs?

Поиск
Список
Период
Сортировка
От Jeff Davis
Тема Re: A better BETWEEN for DATEs, TIMEs and TIMESTAMPs?
Дата
Msg-id 1231968942.32625.120.camel@dell.linuxdev.us.dell.com
обсуждение исходный текст
Ответ на A better BETWEEN for DATEs, TIMEs and TIMESTAMPs?  (Reg Me Please <regmeplease@gmail.com>)
Ответы Re: A better BETWEEN for DATEs, TIMEs and TIMESTAMPs?
Список pgsql-general
On Wed, 2009-01-14 at 11:40 +0100, Reg Me Please wrote:
> Infact I always have managed ranges where the lower part is to be matched with
> the ">=" comparison operator while the higher part is matched with the "<".
> In other words, until now I've always encountered intervals of the
> type "[...)" and not "[...]".
>
> Wouldn't it be nice to have a version of the BETWEEN operator which uses
> such a kind of intervals?

I think the best solution is to make first-class interval types (for
time as well as other types). Those intervals can then have operators
like "contains" and "contained by" which would solve your problem.

Additionally, it would allow lots of other interesting operations, like
overlaps and intersects.

Regards,
    Jeff Davis


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Select CASE when null ?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Odd duplicate database