Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gExBj-0000ym-1i for pgsql-general@arkaria.postgresql.org; Tue, 23 Oct 2018 13:57:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gExBf-00043E-Fw for pgsql-general@arkaria.postgresql.org; Tue, 23 Oct 2018 13:57:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gExBf-000437-5a for pgsql-general@lists.postgresql.org; Tue, 23 Oct 2018 13:57:35 +0000 Received: from mout02.posteo.de ([185.67.36.66]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gExBd-0001FR-1L for pgsql-general@lists.postgresql.org; Tue, 23 Oct 2018 13:57:34 +0000 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id B92352400E5 for ; Tue, 23 Oct 2018 15:57:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1540303050; bh=S3nqo3QG8uMWUL5FvWCB8gjhKauVK3SrOcqe1kByJ74=; h=From:Date:To:Subject:From; b=S58hUUJ3Zup66YjLGA5rwFpMlHUDYjO+YFsJ1edjy2YDKJdFdEeXHIsPmq+lKQBGV GqUJFS7t375zibg/axAgMnbrmwUfTxFpLf6r1vlV+uEWj+EqY1RirsJDgeSGqp+Q0g t3hDylhLg7dwQXtXNImYB42sZ8sfvgmDEiic0ylDGty10cvA+h+nE7iuIW8oyZXIY8 ifgEnt9tqwRDRGHsXOQ/J6Z3EsuByOzDKMcSq1iw0k9asV8CykEb5uTl6814mBkkzs 95YdVO0dzDpu86JD0kJ2tiOTYqrt8lsAWDsS+vWSYmCIhEAFzCrg4Hf3KH/eCWbwEz aI1u6He6GAVuQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 42fZhT0y63z9rxB for ; Tue, 23 Oct 2018 15:57:28 +0200 (CEST) Received: by posteo.de (sSMTP sendmail emulation); Tue, 23 Oct 2018 15:57:28 +0200 From: "Lutz Horn" Date: Tue, 23 Oct 2018 15:57:28 +0200 To: pgsql-general@lists.postgresql.org Subject: Re: Select "todays" timestamps in an index friendly way Message-ID: <20181023135728.GE21523@lutz-pc.ecm4u.intra> References: <20181023093801.GA21523@lutz-pc.ecm4u.intra> <4f78c8fc-d4bd-4219-2877-12004f4dda90@gmx.net> <20181023101949.GC21523@lutz-pc.ecm4u.intra> <85054faa-c527-f9e8-d3a8-b68d4d26421f@gmx.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Tue, Oct 23, 2018 at 03:50:14PM +0200, Francisco Olarte wrote: > It'is not as the problem was stated. Although ts defaulted to now(), > and it is probably defaulted, nothing prohibits him from inserting > timestamps in the future. Yes, this table is only used as an example for the technical question. In my real use case there are columns like "due_date" which usually contain future dates inserted by application code. > the "timestamps in today" pattern is commonly used in calendaring > applications, which usually insert appointments in the future and > recover this way to print "todays schedule". Exactly. The application must be able to execute queries like "give me all my tasks due today" without having to use a concrete value for "today". Lutz