We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f36b636 commit 10a5992Copy full SHA for 10a5992
src/backend/optimizer/plan/setrefs.c
@@ -2936,7 +2936,14 @@ search_indexed_tlist_for_sortgroupref(Expr *node,
2936
{
2937
TargetEntry *tle = (TargetEntry *) lfirst(lc);
2938
2939
- /* The equal() check should be redundant, but let's be paranoid */
+ /*
2940
+ * Usually the equal() check is redundant, but in setop plans it may
2941
+ * not be, since prepunion.c assigns ressortgroupref equal to the
2942
+ * column resno without regard to whether that matches the topmost
2943
+ * level's sortgrouprefs and without regard to whether any implicit
2944
+ * coercions are added in the setop tree. We might have to clean that
2945
+ * up someday; but for now, just ignore any false matches.
2946
+ */
2947
if (tle->ressortgroupref == sortgroupref &&
2948
equal(node, tle->expr))
2949
0 commit comments