Get rid of adjust_appendrel_attr_needed(), which has been broken ever since
Tom Lane <tgl@sss.pgh.pa.us>
Get rid of adjust_appendrel_attr_needed(), which has been broken ever since we extended the appendrel mechanism to support UNION ALL optimization. The reason nobody noticed was that we are not actually using attr_needed data for appendrel children; hence it seems more reasonable to rip it out than fix it. Back-patch to 8.2 because an Assert failure is possible in corner cases. Per examination of an example from Jim Nasby. In HEAD, also get rid of AppendRelInfo.col_mappings, which is quite inadequate to represent UNION ALL situations; depend entirely on translated_vars instead.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/optimizer/path/allpaths.c | modified | +6 −8 |
| src/backend/optimizer/prep/prepunion.c | modified | +1 −65 |
| src/include/optimizer/prep.h | modified | +1 −6 |