summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2019-11-19 14:43:37 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2019-11-19 14:43:37 -0500
commite0457665ccf8052a3ec6d6c37002b81d3b29e235 (patch)
tree3646e4d80a2ca160c6157bdcfb23dddd00260bef
parentff6de57750828030488901aa19fa1580f0f087d8 (diff)
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
-rw-r--r--doc/src/sgml/ref/select.sgml8
1 files changed, 8 insertions, 0 deletions
diff --git a/doc/src/sgml/ref/select.sgml b/doc/src/sgml/ref/select.sgml
index 4db8142afaa..c34e3621939 100644
--- a/doc/src/sgml/ref/select.sgml
+++ b/doc/src/sgml/ref/select.sgml
@@ -282,6 +282,14 @@ TABLE [ ONLY ] <replaceable class="parameter">table_name</replaceable> [ * ]
</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
a data-modifying statement in <literal>WITH</literal> cannot be seen from