Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hLtbF-0005za-Lp for pgsql-general@arkaria.postgresql.org; Wed, 01 May 2019 18:04:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hLtbD-0001FU-RK for pgsql-general@arkaria.postgresql.org; Wed, 01 May 2019 18:04:55 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1hLtbD-0001FI-Hv for pgsql-general@lists.postgresql.org; Wed, 01 May 2019 18:04:55 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hLtb7-0004rT-7J for pgsql-general@postgresql.org; Wed, 01 May 2019 18:04:51 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id CD3B8214DB; Wed, 1 May 2019 14:04:47 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Wed, 01 May 2019 14:04:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=A FpmxlPA6LcOyUyt9KynQhwuc5LTBoWMeTg/EvJFqGg=; b=ssvk+37UNadsjrtiP W/e2rqNF3V8MULztvcga1MWVIc5g6McZqlokCJVQtlqzt4fGFXlpP3wPJ+Er1bYq hoVFNjoW1e8Ckq2nf/gUeghYhrYQkdjyROMaTYAOVU5bzk9UZhLQn2sXdnUhrnz5 IF/5PcCjJ1gbMPkwJmdTI4XC7Jd6SaqysbitLR6/oQRFeg0X0X3+bOuDsMEMss7z SEQ1uUkeT9qbeA+5ticGmt6I8nPpH1lsurKr5c5vXbXtWBLKORoU9dlhjcZ7WN8c lhhaD899W2E0NJv0u1NjV/QBqXsBCFNkzeuXoCm8twfcj2MecH3qLnm1B8jX9SI/ ZQ+Ew== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=AFpmxlPA6LcOyUyt9KynQhwuc5LTBoWMeTg/EvJFq Gg=; b=nlo/68QVzNP/jOFKVHyjd+nc701P8aAG6vAGyk/hEpS5BBDMRco2MtGE3 2RKz/rjEP9z8zjuayOwWojF/sKYverfoyZ265jZuprU5T9nqtBw81ZMBs+sYPX/E IdXPAkDGL/TnumVMFDYVluTIH5lQv0zhQ3jy0RPTaLvln9f10rpuLUn5Hcmmy890 z+GsOghalhx+bArel9BDcKGFOVFfUav7x4f4HBNyc5zWppSqpa3OHh5TWJukHbpQ QObx28uFy/g9EpoMMDPFTL/xYCfhlp0iOQtODnwCwKHx1ctNR133d6+/Xgx046ow lhKcITt9VddKhM1W2cv2ODN5mj9Bw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrieejgdduvdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthejredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucfkphepjeegrdelgedrjeefrddvvddvnecurfgrrhgrmhepmhgrihhlfhhrohhm pegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhmnecuvehluhhsthgvrh fuihiivgeptd X-ME-Proxy: Received: from ranger.suse (unknown [74.94.73.222]) by mail.messagingengine.com (Postfix) with ESMTPA id 4B20DE44A1; Wed, 1 May 2019 14:04:46 -0400 (EDT) Subject: Re: Query not producing expected result To: Francisco Olarte Cc: Chuck Martin , pgsql-general References: <25696.1556728884@sss.pgh.pa.us> <27a5b2e7-9e84-ab43-68a3-d5009e5815a0@aklaver.com> From: Adrian Klaver Message-ID: Date: Wed, 1 May 2019 11:04:44 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 5/1/19 10:58 AM, Francisco Olarte wrote: > Adrian.. > > On Wed, May 1, 2019 at 7:50 PM Adrian Klaver wrote: >> I should have made it clearer, my suggestion was mostly directed at >> Franciso's example. > ... >> For this sort of thing, I have found range types to be a time and sanity >> saver. Just throwing it out there. > > I've had problems with the functions, being used to the [start,end) > notation on paper. I'll look at them again. You don't have to use the functions: test_(postgres)# select dt_fld from dt_test where dt_fld <@ '[2019-02-01, 2019-03-01)'::daterange ; dt_fld ------------ 2019-02-03 2019-02-26 > > But anyway, after so many years of not having intervals and operators, > I read "$start<= $val and $val < $end" as "$val in [$start,$end)", I > think it shares brain paths with "for(;;)" parsing to "forever / > loop". I would like to have the "$start <= $val < $end" which some > language whose name I do not remember has, for complex $vals. > > Francisco Olarte. > -- Adrian Klaver adrian.klaver@aklaver.com