Re: Range Types, constructors, and the type system

From: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: Florian Pflug <fgp(at)phlo(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Range Types, constructors, and the type system
Date: 2011-06-29 17:01:55
Message-ID: E93EA7F3-9995-43B3-89C1-3808A073C095@kineticode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 should be an implementation detail or internal that I never see in SQL. IMHO.

Best,

David

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David E. Wheeler 2011-06-29 17:05:31 Re: Range Types, constructors, and the type system
Previous Message Alvaro Herrera 2011-06-29 16:51:20 Re: Re: starting to review the Extend NOT NULL representation to pg_constraint patch