Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TKP3Y-0007PZ-16 for pgsql-sql@postgresql.org; Sat, 06 Oct 2012 07:44:16 +0000 Received: from mailout01.ims-firmen.de ([213.174.32.96]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TKP3V-00070f-IN for pgsql-sql@postgresql.org; Sat, 06 Oct 2012 07:44:15 +0000 Received: from mailin03.ims-firmen.de ([192.168.1.143]) by mailout01.ims-firmen.de with esmtp (envelope-from ) id 1TKP3T-0004z9-j7 for pgsql-sql@postgresql.org; Sat, 06 Oct 2012 09:44:11 +0200 Received: from [213.174.32.254] (helo=a-kretschmer.de) by mailin03.ims-firmen.de with esmtpsa (TLSv1:AES256-SHA:256) (envelope-from ) id 1TKP3T-0001sO-8r for pgsql-sql@postgresql.org; Sat, 06 Oct 2012 09:44:11 +0200 Received: from kretschmer by a-kretschmer.de with local (Exim 4.69) (envelope-from ) id 1TKP3S-0003hd-Fe for pgsql-sql@postgresql.org; Sat, 06 Oct 2012 09:44:10 +0200 Date: Sat, 6 Oct 2012 09:44:10 +0200 From: Andreas Kretschmer To: pgsql-sql@postgresql.org Subject: Re: checking the gaps in intervals Message-ID: <20121006074410.GA14079@tux> References: <-3205649711969780110@unknownmsgid> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <-3205649711969780110@unknownmsgid> X-OS: Debian/GNU Linux - weil ich es mir Wert bin! X-GPG-Fingerprint: EE16 3C01 7B9C 10F7 2C8B 3B86 4DB3 D9EE 7F45 84DA X-Message-Flag: "Windows" is not the answer. "Windows" is the question and the answer is "no"! X-Lugdd: Gerd Kube X-Info: My name is root. Just root. And I am licensed to kill -9 User-Agent: Mutt/1.5.18 (2008-05-17) X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201210/24 X-Sequence-Number: 36895 Anton Gavazuk wrote: > Hi dear community, > > Have probably quite simple task but cannot find the solution, > > Imagine the table A with 2 columns start and end, data type is date > > start end > 01 dec. 10 dec > 11 dec. 13 dec > 17 dec. 19 dec > ..... > > If I have interval, for example, 12 dec-18 dec, how can I determine > that the interval cannot be fully covered by values from table A > because of the gap 14-16 dec? Looking for solution and unfortunately > nothing has come to the mind yet... I'm thinking about a solution with DATERANGE (PostgreSQL 9.2)... Are start and end including or excluding? Andreas -- Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect. (Linus Torvalds) "If I was god, I would recompile penguin with --enable-fly." (unknown) Kaufbach, Saxony, Germany, Europe. N 51.05082°, E 13.56889°