Re: Range Types, constructors, and the type system - Mailing list pgsql-hackers

From David E. Wheeler
Subject Re: Range Types, constructors, and the type system
Date
Msg-id E93EA7F3-9995-43B3-89C1-3808A073C095@kineticode.com
Whole thread Raw
In response to Re: Range Types, constructors, and the type system  (Jeff Davis <pgsql@j-davis.com>)
List pgsql-hackers
On Jun 28, 2011, at 8:02 PM, Jeff Davis wrote:

> I think David Wheeler was trying to make a similar point, but I'm still
> not convinced.
>
> It's not a pair, because it can be made up of 0, 1, or 2 scalar values
> (unless you count infinity as one of those values, in which case 0 or
> 2). And without ordering, it's not clear that those values are really
> "bounds".
>
> The type needs to:
> * represent two values, either of which might be a special infinite
> value
> * represent the value "empty"
> * represent inclusivity/exclusivity of both values
>
> and those things seem fairly specific to ranges, so I don't really see
> what other use we'd have for such a type. But I'm open to suggestion.
>
> I don't think that having an extra type around is so bad. It solves a
> lot of problems, and doesn't seem like it would get in the way. And it's
> only for the construction of ranges out of scalars, which seems like the
> most natural place where a cast might be required (similar to casting an
> unknown literal, which is fairly common).

I'm fine with that, but my point is that if it's going to be exposed to users somehow, it needs to be useful on its
own,without casting. Because some wit will make a column of this type. If it's not somehow useful on its own, then it
shouldbe an implementation detail or internal that I never see in SQL. IMHO. 

Best,

David



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Re: starting to review the Extend NOT NULL representation to pg_constraint patch
Next
From: "David E. Wheeler"
Date:
Subject: Re: Range Types, constructors, and the type system