postgres.git / summary / log / commit / refs

commit    5bb9954c1cda315add1ceeeec601eadf6ee48c0c
Author:   Tom Lane <tgl@sss.pgh.pa.us>
Date:     Tue Nov 19 19:43:37 2019 +0000
First released in: 13.0, 9.4.26, 9.5.21, 9.6.17, 10.12, 11.7, 12.2

    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 4c8b6f1e73d..ec3bb2bd457 100644 --- a/doc/src/sgml/ref/select.sgml +++ b/doc/src/sgml/ref/select.sgml @@ -281,6 +281,14 @@ TABLE [ ONLY ] <replaceable class="parameter">table_name</replaceable> [ * ] reads all or any of their output. </para> + <para> + When there are multiple queries in the <literal>WITH</literal> + clause, <literal>RECURSIVE</literal> should be written only once, + immediately after <literal>WITH</literal>. It applies to all queries + in the <literal>WITH</literal> clause, though it has no effect on + queries that do not use recursion or forward references. + </para> + <para> The primary query and the <literal>WITH</literal> queries are all (notionally) executed at the same time. This implies that the effects of [parent: 611a4aba15f0]