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

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

Commit: 1cf269cf99b59da9693d95f1c66bccdce11fac4c
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2010-07-08T00:14:41Z
Releases: 7.4.30
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