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 1iWmRc-0000wK-No for pgsql-docs@arkaria.postgresql.org; Mon, 18 Nov 2019 19:12:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iWmRa-0003uo-5w for pgsql-docs@arkaria.postgresql.org; Mon, 18 Nov 2019 19:12:14 +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 1iWmRZ-0003uh-V3 for pgsql-docs@lists.postgresql.org; Mon, 18 Nov 2019 19:12:13 +0000 Received: from mail.i-mark.de ([188.138.104.222]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iWmRX-0001zy-Qf for pgsql-docs@lists.postgresql.org; Mon, 18 Nov 2019 19:12:13 +0000 Received: from [192.168.178.20] (unknown [185.38.49.17]) by mail.i-mark.de (Postfix) with ESMTPSA id 99C891580151; Mon, 18 Nov 2019 20:12:05 +0100 (CET) Authentication-Results: loft7616.startdedicated.de; spf=pass (sender IP is 185.38.49.17) smtp.mailfrom=andreas@a-kretschmer.de smtp.helo=[192.168.178.20] Received-SPF: pass (loft7616.startdedicated.de: connection is authenticated) Subject: Re: documentation for WITH RECURSIVE To: Tom Lane Cc: pgsql-docs@lists.postgresql.org References: <20712.1574098328@sss.pgh.pa.us> From: Andreas Kretschmer Message-ID: <94685a79-0b75-34ad-16bb-e1f23eb28c24@a-kretschmer.de> Date: Mon, 18 Nov 2019 20:12:09 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20712.1574098328@sss.pgh.pa.us> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Am 18.11.19 um 18:32 schrieb Tom Lane: > Andreas Kretschmer writes: >> One of our customers had problems with the syntax of WITH RECURSIVE. He >> suggested that the documentation should be improved, maybe with this >> sentence: >> "If any of the CTEs is recursive, the recursive keywork must be present >> after with", so to make sure that it does not refer to just one of the >> named subqueries. > Hm, was this intended for the SELECT man page (presumably in the > "WITH Clause" section), or for section 7.8? > > In the SELECT page, I'd be inclined to put it after the para about > "queries need not be ordered" and phrase it more like > > If there are multiple queries in the WITH clause, RECURSIVE can > be written only once, immediately after WITH. It applies to all > queries in the WITH clause (but has no effect on queries that do > not use either of these features). > > regards, tom lane yeah, sounds good to me, thx Tom. Regards, Andreas -- 2ndQuadrant - The PostgreSQL Support Company. www.2ndQuadrant.com