Re: Range Types and length function - Mailing list pgsql-hackers

From Florian Pflug
Subject Re: Range Types and length function
Date
Msg-id 9909F6B8-D2CE-4A79-86E7-0F081B950146@phlo.org
Whole thread Raw
In response to Re: Range Types and length function  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: Range Types and length function
List pgsql-hackers
On Jun27, 2011, at 03:12 , Jeff Davis wrote:
> But I think you're right, it shouldn't be the responsibility of range
> types. Perhaps I should leave length() as some inlinable SQL functions
> like I mentioned, or perhaps I should remove them completely.

Does the current definition of length(range), i.e. upper(range) - lower(range)
deal correctly with open vs. closed ranges and unbounded ranges? I'm thinking
that it probably doesn't - what would be the results of length('[0,1]'::intrange) -- Should be 2
length('[0,1)'::intrange)-- Should be 1 length('[0,inf]'::intrange) -- Should be infinity, but ints can't
                represent that, can't they?
 

If it cannot be easily made to support these cases, than I vote for
removing it all together.

best regards,
Florian Pflug



pgsql-hackers by date:

Previous
From: Florian Pflug
Date:
Subject: Re: Range Types, constructors, and the type system
Next
From: Alexander Korotkov
Date:
Subject: Re: WIP: Fast GiST index build