Reimplement CASE val WHEN compval1 THEN ... WHEN compval2 THEN ... END

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 55f7c3300d164d370d28b127210223d078da524d
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2004-03-17T20:48:43Z
Releases: 8.0.0
Reimplement CASE val WHEN compval1 THEN ... WHEN compval2 THEN ... END
so that the 'val' is computed only once, per recent discussion.  The
speedup is not much when 'val' is just a simple variable, but could be
significant for larger expressions.  More importantly this avoids issues
with multiple evaluations of a volatile 'val', and it allows the CASE
expression to be reverse-listed in its original form by ruleutils.c.

Files