Re: Singleton range constructors versus functional coercion notation

Поиск
Список
Период
Сортировка
От Florian Pflug
Тема Re: Singleton range constructors versus functional coercion notation
Дата
Msg-id 6CEF4721-9D8B-4BE8-80C1-34B6E45DC56E@phlo.org
обсуждение исходный текст
Ответ на Re: Singleton range constructors versus functional coercion notation  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Nov19, 2011, at 21:57 , Tom Lane wrote:
> One thing I've been thinking for a bit is that for discrete ranges,
> I find the '[)' canonical form to be surprising/confusing.  If we
> were to fix range_adjacent along the lines suggested by Florian,
> would it be practical to go over to '[]' as the canonical form?
> One good thing about that approach is that canonicalization wouldn't
> have to involve generating values that might overflow.

I have argued against that in the past, mostly because

1) It's better to be consistent

2) While it seems intuitive for integer ranges to use [] and float
ranges to use [), things are far less clear once you take other base
types into account. For example, we'd end up making ranges over DATE
use canonicalize to [], but ranges over TIMESTAMP to [). Which, at least
IMHO, is quite far from intuitive. And if we start "fixing" these issues
by making exception from the "discrete -> [], continuous -> [)" rule,
we'll end up with essentially arbitrary behaviour pretty quickly. At
which point (1) kicks it ;-)

And then there also ranges over NUMERIC, which can be both discrete
and continuous, depending on the typmod. Which I think is a good reason
in itself to make as little behaviour as possible depend on the continuity
or non-continuity of range types.

best regards,
Florian Pflug



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

Предыдущее
От: Florian Pflug
Дата:
Сообщение: Re: range_adjacent and discrete ranges
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: Inlining comparators as a performance optimisation