diff options
author | Shigeru Hanada | 2010-12-03 07:58:59 +0000 |
---|---|---|
committer | Shigeru Hanada | 2010-12-03 07:58:59 +0000 |
commit | 8354254b0a2925db04e98101b0eeb5015ad553c6 (patch) | |
tree | 74c9d9a605168acf0c36f4d0154123fb712c2b66 | |
parent | 1bc612194fac9ce82ff1d76edd887d0e9c13b586 (diff) |
Fix postgresql_fdw to not remove quals from PlanState.qual even ifpgsql_fdw
some of quals are evaluated on remote side. All quals are evaluated
in core executor anytime.
-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. |