Commit 5b805886 authored by Tom Lane's avatar Tom Lane

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
parent 787b3fd3
...@@ -273,6 +273,14 @@ TABLE [ ONLY ] <replaceable class="parameter">table_name</replaceable> [ * ] ...@@ -273,6 +273,14 @@ TABLE [ ONLY ] <replaceable class="parameter">table_name</replaceable> [ * ]
that are earlier in the <literal>WITH</literal> list. that are earlier in the <literal>WITH</literal> list.
</para> </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> <para>
The primary query and the <literal>WITH</literal> queries are all The primary query and the <literal>WITH</literal> queries are all
(notionally) executed at the same time. This implies that the effects of (notionally) executed at the same time. This implies that the effects of
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment