diff options
Diffstat (limited to 'contrib/postgres_fdw/postgres_fdw.c')
-rw-r--r-- | contrib/postgres_fdw/postgres_fdw.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/contrib/postgres_fdw/postgres_fdw.c b/contrib/postgres_fdw/postgres_fdw.c index d6db8340129..9600e3b3c45 100644 --- a/contrib/postgres_fdw/postgres_fdw.c +++ b/contrib/postgres_fdw/postgres_fdw.c @@ -2042,7 +2042,7 @@ postgresRecheckForeignScan(ForeignScanState *node, TupleTableSlot *slot) * 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 @@ -2119,6 +2119,10 @@ postgresPlanDirectModify(PlannerInfo *root, 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; @@ -3305,7 +3309,8 @@ process_query_params(ExprContext *econtext, param_values[i] = NULL; else param_values[i] = OutputFunctionCall(¶m_flinfo[i], expr_value); - i++; + + i++; } reset_transmission_modes(nestlevel); |