We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fd7d7b7 commit a890b87Copy full SHA for a890b87
src/backend/optimizer/util/clauses.c
@@ -3333,6 +3333,13 @@ eval_const_expressions_mutator(Node *node,
3333
-1,
3334
coalesceexpr->coalescecollid);
3335
3336
+ /*
3337
+ * COALESCE with single valued argument looks like identity
3338
+ * function so that it's converged to its single argument
3339
+ */
3340
+ if (list_length(newargs) == 1)
3341
+ return (Node *) linitial(newargs);
3342
+
3343
newcoalesce = makeNode(CoalesceExpr);
3344
newcoalesce->coalescetype = coalesceexpr->coalescetype;
3345
newcoalesce->coalescecollid = coalesceexpr->coalescecollid;
0 commit comments