Re: left and overleft/notright revisited: why !>> and !<<

From: William White <bwhite(at)frognet(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: left and overleft/notright revisited: why !>> and !<<
Date: 2004-04-05 22:59:33
Message-ID: 4071E4D5.4050400@frognet.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Lane wrote:
> William White <bwhite(at)frognet(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Devrim GUNDUZ 2004-04-05 23:12:55 Re: Date differences
Previous Message Eric Ridge 2004-04-05 22:52:48 Re: Cursors and Transactions, why?