Re: "two time periods with only an endpoint in common do not overlap" ???
| От | Tom Lane |
|---|---|
| Тема | Re: "two time periods with only an endpoint in common do not overlap" ??? |
| Дата | |
| Msg-id | 1031323.1634361831@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: "two time periods with only an endpoint in common do not overlap" ??? (Ron <ronljohnsonjr@gmail.com>) |
| Список | pgsql-general |
Ron <ronljohnsonjr@gmail.com> writes:
> OP refers to the OVERLAP operator (is it an operator), not the tsrange()
> function.
Indeed. SQL92 defines OVERLAP thus:
6) The result of the <overlaps predicate> is the result of the
following expression:
( S1 > S2 AND NOT ( S1 >= T2 AND T1 >= T2 ) )
OR
( S2 > S1 AND NOT ( S2 >= T1 AND T2 >= T1 ) )
OR
( S1 = S2 AND ( T1 <> T2 OR T1 = T2 ) )
where S1 is the smaller of the first range's endpoints and T1 is the
larger; similarly S2/T2 are the smaller/larger of the second range's.
(I gloss over the question of what to do with NULL endpoints; but the
apparent redundancies in the above seem to be meant to define what
happens with NULLs.)
I submit that our description using half-open ranges is clearer than
the spec's. Nonetheless, they're equivalent.
regards, tom lane
В списке pgsql-general по дате отправления: