Re: WIP: Range Types

Поиск
Список
Период
Сортировка
От Jeff Davis
Тема Re: WIP: Range Types
Дата
Msg-id 1294335149.18031.3524.camel@jdavis
обсуждение исходный текст
Ответ на Re: WIP: Range Types  (Jeff Davis <pgsql@j-davis.com>)
Ответы Re: WIP: Range Types  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On Wed, 2011-01-05 at 12:07 -0800, Jeff Davis wrote:
> The current design for range types doesn't ask for add or subtract.
> Although it might be interesting to try to use such an interface for
> range types, it introduces a lot of complexity and makes it easier to
> cause subtle problems (consider that addition of timestamps and
> intervals is not commutative).

A consequence of this design is that some generic range functions, like
"length" or "distance" would need to rely on the polymorphism of "+" and
"-" to work.

I'm also not sure if a constructor like "range(start, offset) returns
anyrange" could be made to work generically at all, because the start
and offset may be two different types (and a function that takes
ANYELEMENT requires that all ANYELEMENT arguments are the same type).

Does anyone see a problem with that?

Regards,Jeff Davis



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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Something fishy about the current Makefiles
Следующее
От: Robert Haas
Дата:
Сообщение: Re: WIP: Range Types