Re: postgres_fdw bug in 9.6

Ryan Murphy <ryanfmurphy@gmail.com>

From: Ryan Murphy <ryanfmurphy@gmail.com>
To: pgsql-hackers@postgresql.org
Cc: Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>
Date: 2017-09-05T04:43:36Z
Lists: pgsql-hackers
The following review has been posted through the commitfest application:
make installcheck-world:  tested, passed
Implements feature:       not tested
Spec compliant:           not tested
Documentation:            not tested

This feature is obviously a pretty deep cut, and I don't understand the JOIN system enough to comment on whether the code is correct.  I did not see any issues when glancing through the patch.

I ran "make check", "make installcheck" and "make installcheck-world" and had ALMOST no problems:  I marked it Tested and Passed because the only issue I had was a recurring issue I've had with "make installcheck-world" which I think is unrelated:

*** path/to/postgres/src/interfaces/ecpg/test/expected/connect-test5.stderr 2017-02-14 09:22:25.000000000 -0600
--- path/to/postgres/src/interfaces/ecpg/test/results/connect-test5.stderr  2017-09-04 23:31:50.000000000 -0500
***************
*** 36,42 ****
  [NO_PID]: sqlca: code: 0, state: 00000
  [NO_PID]: ECPGconnect: opening database <DEFAULT> on <DEFAULT> port <DEFAULT>  for user regress_ecpg_user2
  [NO_PID]: sqlca: code: 0, state: 00000
! [NO_PID]: ECPGconnect: could not open database: FATAL:  database "regress_ecpg_user2" does not exist
...

But this still Needs Review by someone who knows the JOIN system better.

Best,
Ryan

Commits

  1. Fix test case for 'outer pathkeys do not match mergeclauses' fix.

  2. postgres_fdw: Avoid 'outer pathkeys do not match mergeclauses' error.

  3. postgres_fdw: Consider foreign joining and foreign sorting together.

  4. Allow foreign and custom joins to handle EvalPlanQual rechecks.

  5. Allow FDWs to push down quals without breaking EvalPlanQual rechecks.