Jeff Davis <pg...@j-davis.com> writes:
> Last development cycle, one of the questions that was unresolved was
> whether to handle ranges like a discrete set (that is, [1,5) = [1,4] )
> or continuous or both.

Put me in the camp that says you need both.  I really seriously dislike
the idea of representing [1, 2) as [1, 2-epsilon], mainly because there
is often no portable value for epsilon.  Dump-and-restore would be quite
hazardous.

> If we treat those as discrete, then R1 = R2, R1 contains R2, R2 contains
> R1, and R2 - R1 = R1 - R2 = empty. However, if we treat those as
> continuous, then we get a contradiction:
>  R2 contains R1
>  R1 does not contain R2
>  R2 - R1 = ( 2009-01-01 01:00:10, 2009-01-01 01:00:10.000001 ) = empty?

This is a circular argument: your conclusion that there's a
contradiction in the concept of continuous ranges depends on the
assumption that the datatype is discrete; and with such an assumption
*of course* you can get a contradiction.

But the real problem is that if the user wants to think in terms of
continuous ranges, the only way that he can convert those to discrete
ranges is to assume an epsilon for the datatype, and he shouldn't be
forced to do that; not even if the datatype does have a well-defined
epsilon at the implementation level, which several of ours don't.

                        regards, tom lane

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to