pgsql: postgres_fdw: Don't push down certain full joins. - Mailing list pgsql-committers

From Robert Haas
Subject pgsql: postgres_fdw: Don't push down certain full joins.
Date
Msg-id E1at5hG-0000qF-Nd@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
postgres_fdw: Don't push down certain full joins.

If there's a filter condition on either side of a full outer join,
it is neither correct to attach it to the join's ON clause nor to
throw it into the toplevel WHERE clause.  Just don't push down the
join in that case.

To maximize the number of cases where we can still push down full
joins, push inner join conditions into the ON clause at the first
opportunity rather than postponing them to the top-level WHERE
clause.  This produces nicer SQL, anyway.

This bug was introduced in e4106b2528727c4b48639c0e12bf2f70a766b910.

Ashutosh Bapat, per report from Rajkumar Raghuwanshi.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/5b1f9ce1d9e8dcae2bcd93b2becffaba5e4f3049

Modified Files
--------------
contrib/postgres_fdw/expected/postgres_fdw.out | 166 +++++++++++++++++--------
contrib/postgres_fdw/postgres_fdw.c            | 108 +++++++++-------
contrib/postgres_fdw/sql/postgres_fdw.sql      |   8 ++
3 files changed, 184 insertions(+), 98 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Honor PGCTLTIMEOUT environment variable for pg_regress' startup
Next
From: Kevin Grittner
Date:
Subject: pgsql: Inline initial comparisons in TestForOldSnapshot()