Re: [HACKERS] postgres_fdw bug in 9.6
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>, 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-30T20:39:09Z
Lists: pgsql-hackers
On Wed, Nov 29, 2017 at 5:32 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote: > AFAICT, [1] just demonstrates that nobody had thought about the scenario > up to that point, not that the subsequently chosen solution was a good > one. But have a look at this: http://postgr.es/m/561E12D4.7040403@lab.ntt.co.jp That shows a case where, before 5fc4c26db5120bd90348b6ee3101fcddfdf54800, a query that required the foreign table to do an EPQ recheck produced an unambiguously wrong answer; the query stipulates that inttab.a = ft1.a but the row returned lacks that property. I think this clearly shows that EPQ rechecks are needed at least for FDW paths that are parameterized. However, I guess that doesn't actually refute your point, which IIUC is that maybe we don't need these checks for FDW join paths, because we don't build parameterized paths for those yet. Now I think it would still be a good idea to have a way of handling that case, because somebody's likely going want to fix that /* XXX Consider parameterized paths for the join relation */ eventually, but I guess for the back-branches just setting epq_path = NULL instead of calling GetExistingLocalJoinPath() might be the way to go... assuming that your contention that this won't break anything is indeed correct. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL 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