@@ -3393,12 +3393,13 @@ check_index_predicates(PlannerInfo *root, RelOptInfo *rel)
33933393 * Normally we remove quals that are implied by a partial index's
33943394 * predicate from indrestrictinfo, indicating that they need not be
33953395 * checked explicitly by an indexscan plan using this index. However, if
3396- * the rel is a target relation of UPDATE/DELETE/SELECT FOR UPDATE, we
3397- * cannot remove such quals from the plan, because they need to be in the
3398- * plan so that they will be properly rechecked by EvalPlanQual testing.
3399- * Some day we might want to remove such quals from the main plan anyway
3400- * and pass them through to EvalPlanQual via a side channel; but for now,
3401- * we just don't remove implied quals at all for target relations.
3396+ * the rel is a target relation of UPDATE/DELETE/MERGE/SELECT FOR UPDATE,
3397+ * we cannot remove such quals from the plan, because they need to be in
3398+ * the plan so that they will be properly rechecked by EvalPlanQual
3399+ * testing. Some day we might want to remove such quals from the main
3400+ * plan anyway and pass them through to EvalPlanQual via a side channel;
3401+ * but for now, we just don't remove implied quals at all for target
3402+ * relations.
34023403 */
34033404is_target_rel = (bms_is_member (rel -> relid ,root -> all_result_relids )||
34043405get_plan_rowmark (root -> rowMarks ,rel -> relid )!= NULL );