Fix "cannot handle unplanned sub-select" error that can occur when a

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

Commit: d4d32eefdf3df4eb9aadea08e3d07af753457fbb
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2010-07-08T00:14:04Z
Releases: 9.0.0
Fix "cannot handle unplanned sub-select" error that can occur when a
sub-select contains a join alias reference that expands into an expression
containing another sub-select.  Per yesterday's report from Merlin Moncure
and subsequent off-list investigation.

Back-patch to 7.4.  Older versions didn't attempt to flatten sub-selects in
ways that would trigger this problem.

Files