Jeff Davis <pgsql@j-davis.com> writes:
> On Mon, 2009-12-14 at 11:25 -0500, Tom Lane wrote:
>> This statement seems to me to demonstrate that you don't actually
>> understand the concept of open and closed ranges.
> Of course you can still define the obvious "contains" and "overlaps"
> operators for a continuous range. But there are specific differences in
> the API between a discrete range and a continuous range, which is what
> Scott was talking about.
Well, if the intention is to invent two different kinds of ranges, with
different operators, for continuous and discrete data types, then fine.
But the original post suggested no such thing, and provided (unworkable)
examples suggesting that the intent was to force every type to be
treated as discrete whether that makes any sense or not.
The main question I would have is how to tell whether the underlying
type is really discrete. If we allow people to define things like
"range over float4 with 0.000001 step", then somebody will try to do it
--- and file bugs when it doesn't work sanely. I don't think there is
anything in our API for user-defined types that really tells you whether
it's an exact or approximate type.
(Also, stuff like strings simply doesn't have any sane concept of a
unique next or previous value. I think the number of types that are
really discrete in this sense is very small, like maybe just ints and
enums.)
regards, tom lane