Re: left and overleft/notright revisited: why !>> and !<< - Mailing list pgsql-general

From William White
Subject Re: left and overleft/notright revisited: why !>> and !<<
Date
Msg-id 4071E4D5.4050400@frognet.net
Whole thread Raw
In response to left and overleft/notright revisited: why !>> and !<< might be poor names  (William White <bwhite@frognet.net>)
List pgsql-general
Tom Lane wrote:
> William White <bwhite@frognet.net> writes:
>
>>Consider the empty interval (n,n) (any empty interval will do, they're
>>all the same empty set),
>
>
> I don't think that's the case.  [0,0) and [1,1) are certainly
> distinguishable given the normal machine representation of intervals.

Every definition of an interval I've seen defines it in terms of a set.

For example, the interval (a,b) in R is the set {x : x > a and x < b}.
Thus, the empty set does not have a unique representation as an interval
in R, just as the nondirected line segments ((0,0),(1,1)) and
((1,1),(0,0)) are identical regardless of the fact that the
representations are not.

Incidentally, my attempts to construct valid operators which *do* treat
various open empty intervals as distinct led to some rather peculiar
(usually inconsistent) results, especially when operating upon empty
open intervals whose endpoints were identical (e.g., (a,a] and (a,a]).

> If you use a mathematical model that says they're not distinguishable,
> that says to me that you chose the wrong model --- especially when the
> model leads you into logical difficulties that need not (and do not)
> exist in the actual implementation.

Do you have an alternative to suggest, given the requirements that the
operators return the expected results on nonempty intervals, and the
usual logic applies (e.g., S @ T and S ~ T ==> S ~= T)


Thanks,

-- Bill

pgsql-general by date:

Previous
From: Devrim GUNDUZ
Date:
Subject: Re: Date differences
Next
From: Bruce Momjian
Date:
Subject: Re: Evening in NYC