]> granicus.if.org Git - postgresql/commitdiff
Document effect of constant folding on CASE.
authorNoah Misch <noah@leadboat.com>
Wed, 26 Jun 2013 23:51:56 +0000 (19:51 -0400)
committerNoah Misch <noah@leadboat.com>
Thu, 27 Jun 2013 00:33:47 +0000 (20:33 -0400)
Back-patch to all supported versions.

Laurenz Albe

doc/src/sgml/func.sgml

index d295ec252108542e7b79dde15bd41163bdf0db52..bbd6605c9936333648c43dcfede89c1cc23a7fa8 100644 (file)
@@ -9981,6 +9981,16 @@ SELECT a,
 SELECT ... WHERE CASE WHEN x &lt;&gt; 0 THEN y/x &gt; 1.5 ELSE false END;
 </programlisting>
    </para>
+
+   <note>
+    <para>
+     As described in <xref linkend="xfunc-volatility">, functions and
+     operators marked <literal>IMMUTABLE</literal> can be evaluated when
+     the query is planned rather than when it is executed.  This means
+     that constant parts of a subexpression that is not evaluated during
+     query execution might still be evaluated during query planning.
+    </para>
+   </note>
   </sect2>
 
   <sect2 id="functions-coalesce-nvl-ifnull">