From 121f49a00e432ee9cfad7270d99504350cd1015f Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 16 Apr 2011 16:39:50 -0400 Subject: 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. --- src/backend/optimizer/prep/prepjointree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/backend/optimizer/prep/prepjointree.c') diff --git a/src/backend/optimizer/prep/prepjointree.c b/src/backend/optimizer/prep/prepjointree.c index a40f116bf9a..a70439cc674 100644 --- a/src/backend/optimizer/prep/prepjointree.c +++ b/src/backend/optimizer/prep/prepjointree.c @@ -1136,7 +1136,7 @@ is_simple_union_all_recurse(Node *setOp, Query *setOpQuery, List *colTypes) Assert(subquery != NULL); /* Leaf nodes are OK if they match the toplevel column types */ - /* We don't have to compare typmods here */ + /* We don't have to compare typmods or collations here */ return tlist_same_datatypes(subquery->targetList, colTypes, true); } else if (IsA(setOp, SetOperationStmt)) -- cgit v1.2.3