Fix "cannot handle unplanned sub-select" error that can occur when a
authorTom Lane <[email protected]>
Thu, 8 Jul 2010 00:14:28 +0000 (00:14 +0000)
committerTom Lane <[email protected]>
Thu, 8 Jul 2010 00:14:28 +0000 (00:14 +0000)
commitaccabacce905371f94d9d9a00e308931b56b7d67
tree6baca54af7f03b8ad1c6d08e724ed5be6ffe9438
parent9654b60cfc7443a870e2784066f02d5f42cb24ee
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.
src/backend/optimizer/util/var.c
src/test/regress/expected/subselect.out
src/test/regress/sql/subselect.sql