Re: [HACKERS] postgres_fdw bug in 9.6
Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>
From: Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>, Jeff Janes <jeff.janes@gmail.com>, David Steele <david@pgmasters.net>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2017-11-29T03:43:24Z
Lists: pgsql-hackers
On Tue, Nov 28, 2017 at 11:05 PM, Robert Haas <robertmhaas@gmail.com> wrote: > On Tue, Nov 28, 2017 at 11:21 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote: >> In short, we should get rid of all of this expensive and broken logic and >> just make EPQ recheck on a foreign join be a no-op, just as it is for a >> foreign base table. > > I'm not sure that it is. What of > 5fc4c26db5120bd90348b6ee3101fcddfdf54800? That was before I started > putting "Discussion" links into commit messages as a matter of > routine, but I'm pretty sure that fixed what seemed to Etsuro Fujita, > Kyotaro Horiguchi, and myself to be pretty clear misbehavior. See > also 385f337c9f39b21dca96ca4770552a10a6d5af24. We've put an awful lot > of effort into this over the last few years; I'm a bit hesitant to > believe none of that did anything. > IIUC, the problem here is not about stale foreign tuples (or whether they can change) - as you described above they can not, since we have requested FOR UPDATE. But when a foreign join is further joined with a local table, tuples in which change after they are joined, we need to make sure that the total join tuple (local table joined with foreign join) still qualifies. We do this by locally joining those rows again. [1] is where the discussion started [1] https://www.postgresql.org/message-id/558A18B3.9050201@lab.ntt.co.jp -- Best Wishes, Ashutosh Bapat EnterpriseDB Corporation The Postgres Database Company
Commits
-
Fix test case for 'outer pathkeys do not match mergeclauses' fix.
- d397f558d555 9.6.7 landed
- 92123c6ea212 10.2 landed
- 99f6a17dd62a 11.0 landed
-
postgres_fdw: Avoid 'outer pathkeys do not match mergeclauses' error.
- 4a81c022975e 9.6.7 landed
- 3f05a30b50a7 10.2 landed
- 4bbf6edfbd5d 11.0 landed
-
postgres_fdw: Consider foreign joining and foreign sorting together.
- aa09cd242fa7 9.6.0 cited
-
Allow foreign and custom joins to handle EvalPlanQual rechecks.
- 385f337c9f39 9.6.0 cited
-
Allow FDWs to push down quals without breaking EvalPlanQual rechecks.
- 5fc4c26db512 9.6.0 cited