Re: overlaps() does not work as expected?
От | Jochem van Dieten |
---|---|
Тема | Re: overlaps() does not work as expected? |
Дата | |
Msg-id | f96a9b830505271128493412f2@mail.gmail.com обсуждение исходный текст |
Ответ на | overlaps() does not work as expected? (Mario Weilguni <mweilguni@sime.com>) |
Список | pgsql-hackers |
On 5/27/05, Mario Weilguni wrote: > I've quite some trouble with the overlaps function: > SELECT overlaps('9.6.2005'::date, '9.6.2005'::date, '9.6.2005'::date, > '9.6.2005'::date); > returns true (these are german timestamps dd.mm.yyyy) > > SELECT overlaps('8.6.2005'::date, '9.6.2005'::date, '9.6.2005'::date, > '9.6.2005'::date); > returns false > > Is this a bug or a (quite strange) feature? It is consistent with the SQL standard: <quote> <overlaps predicate> uses the operator OVERLAPS to determine whether or not two chronological periods overlap in time. A chronological period is specified aither as a pair of datetimes (starting and ending) or as a starting datetime and an interval. If the length of the period is greater than 0 (zero), then the period consists of all points of time greater than or equal to the lower endpoint, and less than the upper endpoint. If the length of the period is equal to 0 (zero), then the period consists of a single point in time, the lower endpoint. Two periods overlap if they have at least one point in common. </quote> ISO/IEC 9075-2:2003 4.6 Datetimes and intervals. For those who prefer BNF look at 8.13 <overlaps predicate> in said standard. Jochem
В списке pgsql-hackers по дате отправления: