Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 69F3C6332DA for ; Tue, 20 Apr 2010 20:50:28 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 73290-02-3 for ; Tue, 20 Apr 2010 23:50:18 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from noel.decibel.org (99-153-64-76.uvs.austtx.sbcglobal.net [99.153.64.76]) by mail.postgresql.org (Postfix) with ESMTP id EFC62633D84 for ; Tue, 20 Apr 2010 20:50:17 -0300 (ADT) Received: from wifi-dhcp-55-243.chi.cashnetusa.com (chi-pat.cashnetusa.com [38.98.177.132]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by noel.decibel.org (Postfix) with ESMTP id 6165F56447 for ; Tue, 20 Apr 2010 23:50:16 +0000 (UTC) From: Jim Nasby Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: Inconsistency in docs for OVERLAPS Date: Tue, 20 Apr 2010 18:34:00 -0500 Message-Id: <1FF2D1B3-E932-44FA-93F5-EFDD843C5781@decibel.org> To: PostgreSQL-documentation Mime-Version: 1.0 (Apple Message framework v1078) X-Mailer: Apple Mail (2.1078) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.918 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RDNS_DYNAMIC=0.982 X-Spam-Level: X-Archive-Number: 201004/71 X-Sequence-Number: 5470 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')=20 OVERLAPS (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@nasby.net 512.569.9461 (cell) http://jim.nasby.net