Fix bug with WITH RECURSIVE immediately inside WITH RECURSIVE. 99% of the

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

Commit: 255f66efa9b648500a4f06b839d0256987406f0f
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2009-09-09T03:32:52Z
Releases: 9.0.0
Fix bug with WITH RECURSIVE immediately inside WITH RECURSIVE.  99% of the
code was already okay with this, but the hack that obtained the output
column types of a recursive union in advance of doing real parse analysis
of the recursive union forgot to handle the case where there was an inner
WITH clause available to the non-recursive term.  Best fix seems to be to
refactor so that we don't need the "throwaway" parse analysis step at all.
Instead, teach the transformSetOperationStmt code to set up the CTE's output
column information after it's processed the non-recursive term normally.
Per report from David Fetter.

Files