Re: Range types

Поиск
Список
Период
Сортировка
От Scott Bailey
Тема Re: Range types
Дата
Msg-id 4B2665CD.9010503@comcast.net
обсуждение исходный текст
Ответ на Re: Range types  (Martijn van Oosterhout <kleptog@svana.org>)
Ответы Re: Range types  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Martijn van Oosterhout wrote:
> On Sun, Dec 13, 2009 at 11:49:53PM -0800, Scott Bailey wrote:
>> So basically I have an anyrange pseudo type with the functions prev,  
>> next, last, etc defined. So instead of hard coding range types, we would  
>> allow the user to define their own range types. Basically if we are able  
>> to determine the previous and next values of the base types we'd be able  
>> to define a range type. I'm envisioning in a manner much like defining  
>> an enum type.
> 
> I find it odd that you could define functions next() and prev() since
> that assumes some kind of dicretisation which simply does not exist for
> most types I can think of.

Because intervals (mathematical not SQL) can be open or closed at each 
end point we need to know what the next an previous value would be at 
the specified granularity. And while you can do some operations without 
knowing this, there are many you can't. For instance you could not tell 
whether two [] or () ranges were adjacent, or be able to coalesce an 
array of ranges.

> It would seem to me the real useful uses of ranges would be the
> operations overlaps, disjoint, proceeds, follows, etc, which could all
> be defined on any well-ordered type (wherever greater-than and
> less-than are well defined). No need to discretise anything.
> 
> Do you have any actual usecase for a distretized range type for
> timestamp?




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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: WAL Info messages
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Hot Standby, release candidate?