diff options
-rw-r--r-- | contrib/postgresql_fdw/postgresql_fdw.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/contrib/postgresql_fdw/postgresql_fdw.c b/contrib/postgresql_fdw/postgresql_fdw.c index cd7902df81..9044ab6cad 100644 --- a/contrib/postgresql_fdw/postgresql_fdw.c +++ b/contrib/postgresql_fdw/postgresql_fdw.c @@ -383,8 +383,6 @@ deparseSql(ForeignScanState *scanstate) */ if (scanstate->ss.ps.plan->qual) { - List *local_qual = NIL; - List *foreign_qual = NIL; List *foreign_expr = NIL; ListCell *lc; @@ -397,18 +395,8 @@ deparseSql(ForeignScanState *scanstate) ExprState *state = lfirst(lc); if (is_foreign_qual(state->expr)) - { foreign_qual = lappend(foreign_qual, state); foreign_expr = lappend(foreign_expr, state->expr); - } - else - local_qual = lappend(local_qual, state); } - /* - * XXX: If the remote side is not reliable enough, we can keep the qual - * in PlanState as is and evaluate them on local side too. If so, just - * omit replacement below. - */ - scanstate->ss.ps.qual = local_qual; /* * Deparse quals to be evaluated in the foreign server if any. @@ -421,6 +409,7 @@ deparseSql(ForeignScanState *scanstate) node = (Node *) make_ands_explicit(foreign_expr); appendStringInfo(&sql, " WHERE %s", deparse_expression(node, context, prefix, false)); + /* * The contents of the list MUST NOT be free-ed because they are * referenced from Plan.qual list. |