int attnum = lfirst_int(lc);
TargetEntry *tle = get_tle_by_resno(targetlist, attnum);
+ if (!tle)
+ elog(ERROR, "attribute number %d not found in UPDATE targetlist",
+ attnum);
+
if (!first)
appendStringInfoString(buf, ", ");
first = false;
* postgresPlanDirectModify
* Consider a direct foreign table modification
*
- * Decide whether it is safe to modify a foreign table directly, and if so,
+ * Decide whether it is safe to modify a foreign table directly, and if so,
* rewrite subplan accordingly.
*/
static bool
tle = get_tle_by_resno(subplan->targetlist, attno);
+ if (!tle)
+ elog(ERROR, "attribute number %d not found in subplan targetlist",
+ attno);
+
if (!is_foreign_expr(root, baserel, (Expr *) tle->expr))
return false;
param_values[i] = NULL;
else
param_values[i] = OutputFunctionCall(¶m_flinfo[i], expr_value);
- i++;
+
+ i++;
}
reset_transmission_modes(nestlevel);