Skip site navigation (1) Skip section navigation (2)

Inconsistency in docs for OVERLAPS

From: Jim Nasby <decibel(at)decibel(dot)org>
To: PostgreSQL-documentation <pgsql-docs(at)postgresql(dot)org>
Subject: Inconsistency in docs for OVERLAPS
Date: 2010-04-20 23:34:00
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-docs
Per 8.3 and 8.4 docs:

"In addition to these functions, the SQL OVERLAPS operator is supported:

(start1, end1) OVERLAPS (start2, end2)
(start1, length1) OVERLAPS (start2, length2)
This expression yields true when two time periods (defined by their endpoints) overlap, false when they do not overlap. The endpoints can be specified as pairs of dates, times, or time stamps; or as a date, time, or time stamp followed by an interval."

So we accept (datetime,datetime) OVERLAPS (datetime,datetime) or (datetime,interval) OVERLAPS (datetime,interval)

However, the example shows yet another case:

"SELECT (DATE '2001-02-16', DATE '2001-12-21') OVERLAPS

       (DATE '2001-10-30', DATE '2002-10-30');

Result: true

SELECT (DATE '2001-02-16', INTERVAL '100 days') 

       (DATE '2001-10-30', DATE '2002-10-30');

Result: false

And in reality, (timestamp, interval) OVERLAPS (timestamp, timestamp) does work, first part of this is incomplete.
Jim C. Nasby, Database Architect                   jim(at)nasby(dot)net
512.569.9461 (cell)               

pgsql-docs by date

Next:From: Tom LaneDate: 2010-04-20 23:53:36
Subject: Re: [HACKERS] Streaming replication document improvements
Previous:From: Kevin GrittnerDate: 2010-04-20 14:24:38
Subject: Re: [HACKERS] Streaming replication document improvements

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group