| | 63 | |
| | 64 | This function does not only compare equal dates. It compares complete timestamp intervals using: |
| | 65 | |
| | 66 | {{{ |
| | 67 | #!sql |
| | 68 | (new_start < existing_end) AND (new_end > existing_start) |
| | 69 | }}} |
| | 70 | |
| | 71 | This condition detects all possible overlap cases: |
| | 72 | * the new interval starts inside an existing interval |
| | 73 | * the new interval ends inside an existing interval |
| | 74 | * the new interval completely contains an existing interval |
| | 75 | * the existing interval completely contains the new interval |
| | 76 | * both intervals are exactly the same |
| | 77 | * intervals that only touch at the boundary are not treated as overlapping |