Thread: pgsql: Clean up collation processing in prepunion.c.

pgsql: Clean up collation processing in prepunion.c.

From
Tom Lane
Date:
Clean up collation processing in prepunion.c.

This area was a few bricks shy of a load, and badly under-commented too.
We have to ensure that the generated targetlist entries for a set-operation
node expose the correct collation for each entry, since higher-level
processing expects the tlist to reflect the true ordering of the plan's
output.

This hackery wouldn't be necessary if SortGroupClause carried collation
info ... but making it do so would inject more pain in the parser than
would be saved here.  Still, we might want to rethink that sometime.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/121f49a00e432ee9cfad7270d99504350cd1015f

Modified Files
--------------
src/backend/optimizer/prep/prepjointree.c |    2 +-
src/backend/optimizer/prep/prepunion.c    |  131 +++++++++++++++++++++--------
src/backend/optimizer/util/tlist.c        |   34 ++++++++
src/include/optimizer/tlist.h             |    1 +
4 files changed, 132 insertions(+), 36 deletions(-)