From 6e8516ef6c60adbcc40e2b913cafebf214f1d99c Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 19 Nov 2019 14:43:37 -0500 Subject: [PATCH] Doc: clarify use of RECURSIVE in WITH. Apparently some people misinterpreted the syntax as being that RECURSIVE is a prefix of individual WITH queries. It's a modifier for the WITH clause as a whole, so state that more clearly. Discussion: https://postgr.es/m/ca53c6ce-a0c6-b14a-a8e3-162f0b2cc119@a-kretschmer.de --- doc/src/sgml/ref/select.sgml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/src/sgml/ref/select.sgml b/doc/src/sgml/ref/select.sgml index a8c41ff09e0..6e2d4e8adc1 100644 --- a/doc/src/sgml/ref/select.sgml +++ b/doc/src/sgml/ref/select.sgml @@ -271,6 +271,14 @@ TABLE [ ONLY ] table_name [ * ] reads all or any of their output. + + When there are multiple queries in the WITH + clause, RECURSIVE should be written only once, + immediately after WITH. It applies to all queries + in the WITH clause, though it has no effect on + queries that do not use recursion or forward references. + + The primary query and the WITH queries are all (notionally) executed at the same time. This implies that the effects of -- 2.39.5