Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jc6r8-0002Np-BR for pgsql-hackers@arkaria.postgresql.org; Fri, 22 May 2020 12:32:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jc6r5-0005Cg-51 for pgsql-hackers@arkaria.postgresql.org; Fri, 22 May 2020 12:32:51 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jc6r4-0005CZ-Te for pgsql-hackers@lists.postgresql.org; Fri, 22 May 2020 12:32:50 +0000 Received: from wforward3-smtp.messagingengine.com ([64.147.123.22]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jc6r0-0005fh-8r for pgsql-hackers@postgresql.org; Fri, 22 May 2020 12:32:49 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailforward.west.internal (Postfix) with ESMTP id 73067C44; Fri, 22 May 2020 08:32:43 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Fri, 22 May 2020 08:32:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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=pxj9nfs+worD+3mDEPMHoFP3S8Jc7ferbtSDrmZkm Cg=; b=Ga5Lz9wXumPPcdadOF0+u1fbRTUHjD8mIxA0WRpuSurrfzQFKg2TBtjNm vbqoQaHavWHwpa3bC8ux+NtJCJVPikAHQnxJ9534P11dzQqRbBIrOlNddY0hv+zs pHwABwpSk5WZ2gFc7EY7n2Ovs4eFt8Q5mlrAn5lz4/JYTgB4l52dzPlDheFuUNU6 HGDVOOUBzimgyR1nuxz67Oy8xoLj2dfLWDgYYdzhLyE0A3GcZHYddtYRDhPYSPVU 5gDQ3ESq3XI6hlfkmCEVh+ulGbLvA2lpqrSH6PsHo5oigplUSw0C3zw2DgN79laQ 6ON4qMcVmcjymddpKlkLpvEo+G4mw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedruddufedgheefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvfhfhfhokffffgggjggtgfesth ekredttdefjeenucfhrhhomheprfgvthgvrhcugfhishgvnhhtrhgruhhtuceophgvthgv rhdrvghishgvnhhtrhgruhhtsedvnhguqhhurggurhgrnhhtrdgtohhmqeenucggtffrrg htthgvrhhnpeelffffteffjeefhfehffevkeeiteeikedufeffhfehveeilefhtefhgeef udehtdenucffohhmrghinhepvdhnughquhgrughrrghnthdrtghomhenucfkphepleefrd dvgeefrdekvddrvdegieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgr ihhlfhhrohhmpehpvghtvghrrdgvihhsvghnthhrrghuthesvdhnughquhgrughrrghnth drtghomh X-ME-Proxy: Received: from april.pezone.net (p5df352f6.dip0.t-ipconnect.de [93.243.82.246]) by mail.messagingengine.com (Postfix) with ESMTPA id 3324D328005E; Fri, 22 May 2020 08:32:42 -0400 (EDT) Subject: Re: SEARCH and CYCLE clauses To: Vik Fearing , pgsql-hackers References: <54e533c5-09e5-7f41-9892-d4e0f7c62598@postgresfriends.org> <1cfc9079-9595-d167-00e6-5014438cc3e2@2ndquadrant.com> <9ce4d370-048c-1d67-fffb-a86f17120132@postgresfriends.org> From: Peter Eisentraut Organization: 2ndQuadrant Message-ID: Date: Fri, 22 May 2020 14:32:41 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <9ce4d370-048c-1d67-fffb-a86f17120132@postgresfriends.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-05-22 12:40, Vik Fearing wrote: >> If you specify null, then the cycle check expression will always fail, >> so it will abort after the first row.  (We should perhaps prohibit >> specifying null, but see below.) > > I would rather make the cycle check expression work with null. It works correctly AFAICT. What is your expectation? >> This is something we need to think about.  If we want to check at parse >> time whether the two values are not the same (and perhaps not null), >> then we either need to restrict the generality of what we can specify, >> or we need to be prepared to do full expression evaluation in the >> parser.  A simple and practical way might be to only allow string and >> boolean literal.  I don't have a strong opinion here. > > > I'm with Pavel on this one. Why does it have to be a parse-time error? > Also, I regularly see people write functions as sort of pauper's > variables, but a function call isn't allowed here. If not parse-time error, at what time do you want to check it? > As an improvement over the spec, I think the vast majority of people > will be using simple true/false values. Can we make that optional? > > CYCLE f, t SET is_cycle USING path > > would be the same as > > CYCLE f, t SET is_cycle TO true DEFAULT false USING path I was also considering that. It would be an easy change to make. (Apparently, in DB2 you can omit the USING path clause. Not sure how to make that work, however.) -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services