Re: Bogus EPQ plan construction in postgres_fdw
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2018-12-14T22:07:00Z
Lists: pgsql-hackers
On Wed, Dec 12, 2018 at 8:00 PM Tom Lane <tgl@sss.pgh.pa.us> wrote: > By chance I noticed that postgres_fdw's postgresGetForeignPlan() assumes > --- without any checking --- that the outer_plan it's given for a join > relation must have a NestLoop, MergeJoin, or HashJoin node at the top. > That's been wrong at least since commit 4bbf6edfb (which could cause > insertion of a Sort node on top) and it seems like a pretty unsafe > thing to Just Assume even without that. Thanks for taking care of this. I've looked at this code any number of times and never quite noticed the assumption that outer_plan had to be a join. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
Commits
-
Repair bogus EPQ plans generated for postgres_fdw foreign joins.
- 8a7f24b22fd3 10.7 landed
- 77d4d88afbaa 12.0 landed
- 7465871879ab 11.2 landed
- 12cb7ea599fb 9.6.12 landed
-
postgres_fdw: Avoid 'outer pathkeys do not match mergeclauses' error.
- 4bbf6edfbd5d 11.0 cited