From: Shigeru Hanada Date: Mon, 1 Nov 2010 01:01:57 +0000 (+0900) Subject: Fix postgresql_fdw to evaluate quals which have been pushed down to X-Git-Url: http://git.postgresql.org/gitweb/-?a=commitdiff_plain;h=c974e9677e7eeb951ada255efa9334b3e9e235c1;p=users%2Fhanada%2Fpostgres.git Fix postgresql_fdw to evaluate quals which have been pushed down to remote side. --- diff --git a/contrib/postgresql_fdw/postgresql_fdw.c b/contrib/postgresql_fdw/postgresql_fdw.c index c319daa14a..77ede71be1 100644 --- a/contrib/postgresql_fdw/postgresql_fdw.c +++ b/contrib/postgresql_fdw/postgresql_fdw.c @@ -442,11 +442,15 @@ deparseSql(ForeignScanState *scanstate) } /* - * If the optimization level is EVAL_QUAL_FOREIGN, replace the original - * qual with the list of ExprStates which should be evaluated in the - * local server. + * To ensure the result tuples are correct (at least they don't violate + * the quals), we evaluate the quals again on local side even if the + * qual have been evaluated on remote side. If the remote side is + * enough reliable, we can remove quals which have been pushed down + * from PlanState. */ +#if 0 scanstate->ss.ps.qual = local_qual; +#endif /* * Deparse quals to be evaluated in the foreign server if any.