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 1jbOOh-0003Qv-82 for pgsql-hackers@arkaria.postgresql.org; Wed, 20 May 2020 13:04:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jbOOg-0007hI-3d for pgsql-hackers@arkaria.postgresql.org; Wed, 20 May 2020 13:04:34 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jbOOf-0007hB-Td for pgsql-hackers@lists.postgresql.org; Wed, 20 May 2020 13:04:33 +0000 Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jbOOY-0003Df-CR for pgsql-hackers@postgresql.org; Wed, 20 May 2020 13:04:32 +0000 X-Originating-IP: 93.10.30.82 Received: from [172.16.255.146] (82.30.10.93.rev.sfr.net [93.10.30.82]) (Authenticated sender: vik@postgresfriends.org) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id B2EA8E0016; Wed, 20 May 2020 13:04:21 +0000 (UTC) Subject: Re: SEARCH and CYCLE clauses To: Peter Eisentraut , pgsql-hackers References: From: Vik Fearing Message-ID: <54e533c5-09e5-7f41-9892-d4e0f7c62598@postgresfriends.org> Date: Wed, 20 May 2020 15:04:20 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 5/20/20 1:46 PM, Peter Eisentraut wrote: > I have implemented the SEARCH and CYCLE clauses. YES! > This is standard SQL syntax attached to a recursive CTE to compute a > depth- or breadth-first ordering and cycle detection, respectively. This > is just convenience syntax for what you can already do manually. The > original discussion about recursive CTEs briefly mentioned these as > something to do later but then it was never mentioned again. > > SQL specifies these in terms of syntactic transformations, and so that's > how I have implemented them also, mainly in the rewriter. I've attempted to do this several times but didn't get anywhere with it. I'm looking forward to reviewing this. (And maybe it will put me on the right path for implementing .) -- Vik Fearing