diff --git a/src/backend/optimizer/path/joinpath.c b/src/backend/optimizer/path/joinpath.c
index bad3dd1..9b4da67 100644
--- a/src/backend/optimizer/path/joinpath.c
+++ b/src/backend/optimizer/path/joinpath.c
@@ -450,6 +450,15 @@ paraminfo_get_equal_hashops(PlannerInfo *root, ParamPathInfo *param_info,
 				return false;
 			}
 
+			/*
+			 * Ensure the cache key exposes the clause's input collation, so
+			 * that Memoize compares keys the same way the clause does.  See
+			 * comments for canonicalize_ec_expression.
+			 */
+			expr = (Node *) canonicalize_ec_expression((Expr *) expr,
+													   exprType(expr),
+													   opexpr->inputcollid);
+
 			*operators = lappend_oid(*operators, hasheqoperator);
 			*param_exprs = lappend(*param_exprs, expr);
 
