Improve documentation about CASE and constant subexpressions.
authorTom Lane
Thu, 18 Dec 2014 21:38:58 +0000 (16:38 -0500)
committerTom Lane
Thu, 18 Dec 2014 21:38:58 +0000 (16:38 -0500)
commitef8472bc7adb2740010ad4fefdae63151bc66f39
treeb0bd3ed6a7918c0da424cd60288f995103b5a4f9
parenta47f38e526f70b397c1941f331e729e5fab95d27
Improve documentation about CASE and constant subexpressions.

The possibility that constant subexpressions of a CASE might be evaluated
at planning time was touched on in 9.17.1 (CASE expressions), but it really
ought to be explained in 4.2.14 (Expression Evaluation Rules) which is the
primary discussion of such topics.  Add text and an example there, and
revise the  under CASE to link there.

Back-patch to all supported branches, since it's acted like this for a
long time (though 9.2+ is probably worse because of its more aggressive
use of constant-folding via replanning of nominally-prepared statements).
Pre-9.4, also back-patch text added in commit 0ce627d4 about CASE versus
aggregate functions.

Tom Lane and David Johnston, per discussion of bug #12273.
doc/src/sgml/func.sgml
doc/src/sgml/syntax.sgml