postgresql/src
Tom Lane 1eeee69099 Ensure that foreign scans with lateral refs are planned correctly.
As reported in bug #15613 from Srinivasan S A, file_fdw and postgres_fdw
neglected to mark plain baserel foreign paths as parameterized when the
relation has lateral_relids.  Other FDWs have surely copied this mistake,
so rather than just patching those two modules, install a band-aid fix
in create_foreignscan_path to rectify the mistake centrally.

Although the band-aid is enough to fix the visible symptom, correct
the calls in file_fdw and postgres_fdw anyway, so that they are valid
examples for external FDWs.

Also, since the band-aid isn't enough to make this work for parameterized
foreign joins, throw an elog(ERROR) if such a case is passed to
create_foreignscan_path.  This shouldn't pose much of a problem for
existing external FDWs, since it's likely they aren't trying to make such
paths anyway (though some of them may need a defense against joins with
lateral_relids, similar to the one this patch installs into postgres_fdw).

Add some assertions in relnode.c to catch future occurrences of the same
error --- in particular, as backstop against core-code mistakes like the
one fixed by commit bdd9a99aa.

Discussion: https://postgr.es/m/15613-092be1be9576c728@postgresql.org
2019-02-07 13:11:17 -05:00
..
backend Ensure that foreign scans with lateral refs are planned correctly. 2019-02-07 13:11:17 -05:00
bin Fix searchpath and module location for pg_rewind and ssl TAP tests 2019-02-07 11:10:59 -05:00
common Fix portability failure introduced in commits d2b0b60e7 et al. 2018-12-26 15:30:35 -05:00
include Fix misc typos in comments. 2019-01-23 13:46:51 +02:00
interfaces Remove infinite-loop hazards in ecpg test suite. 2019-01-24 16:46:56 -05:00
makefiles Move port-specific parts of with_temp_install to port makefile. 2019-02-04 19:00:18 +00:00
pl Fix misc typos in comments. 2019-01-23 13:46:51 +02:00
port Use our own getopt() on OpenBSD. 2019-01-18 15:06:26 -05:00
template Yet further rethinking of build changes for macOS Mojave. 2018-11-02 18:54:00 -04:00
test Fix searchpath and module location for pg_rewind and ssl TAP tests 2019-02-07 11:10:59 -05:00
timezone Update time zone data files to tzdata release 2018i. 2019-02-05 10:59:31 -05:00
tools Unify searchpath and do file logic in MSVC build scripts. 2019-02-06 07:55:10 -05:00
tutorial Remove no-longer-required function declarations. 2015-05-24 12:20:23 -04:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
bcc32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Install TAP test infrastructure so it's available for extension testing. 2016-09-23 15:50:00 -04:00
Makefile.global.in Move port-specific parts of with_temp_install to port makefile. 2019-02-04 19:00:18 +00:00
Makefile.shlib Ensure static libraries have correct mod time even if ranlib messes it up. 2018-11-29 15:53:44 -05:00
nls-global.mk nls-global.mk: search build dir for source files, too 2016-06-07 18:55:18 -04:00
win32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00