postgresql/src/backend
Tom Lane bb94ce4d26 Teach reparameterize_path() to handle AppendPaths.
If we're inside a lateral subquery, there may be no unparameterized paths
for a particular child relation of an appendrel, in which case we *must*
be able to create similarly-parameterized paths for each other child
relation, else the planner will fail with "could not devise a query plan
for the given query".  This means that there are situations where we'd
better be able to reparameterize at least one path for each child.

This calls into question the assumption in reparameterize_path() that
it can just punt if it feels like it.  However, the only case that is
known broken right now is where the child is itself an appendrel so that
all its paths are AppendPaths.  (I think possibly I disregarded that in
the original coding on the theory that nested appendrels would get folded
together --- but that only happens *after* reparameterize_path(), so it's
not excused from handling a child AppendPath.)  Given that this code's been
like this since 9.3 when LATERAL was introduced, it seems likely we'd have
heard of other cases by now if there were a larger problem.

Per report from Elvis Pranskevichus.  Back-patch to 9.3.

Discussion: https://postgr.es/m/5981018.zdth1YWmNy@hammer.magicstack.net
2018-01-23 16:50:34 -05:00
..
access Update obsolete sentence in README.parallel. 2018-01-23 11:22:47 -05:00
bootstrap Local partitioned indexes 2018-01-19 11:49:22 -03:00
catalog Suppress possibly-uninitialized-variable warnings. 2018-01-19 22:16:25 -05:00
commands Transaction control in PL procedures 2018-01-22 08:43:06 -05:00
executor Transaction control in PL procedures 2018-01-22 08:43:06 -05:00
foreign Update copyright for 2018 2018-01-02 23:30:12 -05:00
lib Update copyright for 2018 2018-01-02 23:30:12 -05:00
libpq Extract common bits from OpenSSL implementation 2018-01-23 07:11:39 -05:00
main Update copyright for 2018 2018-01-02 23:30:12 -05:00
nodes Allow UPDATE to move rows between partitions. 2018-01-19 15:33:06 -05:00
optimizer Teach reparameterize_path() to handle AppendPaths. 2018-01-23 16:50:34 -05:00
parser Replace AclObjectKind with ObjectType 2018-01-19 14:01:15 -05:00
po Translation updates 2017-08-07 13:55:34 -04:00
port Support huge pages on Windows 2018-01-21 15:40:46 +01:00
postmaster Remove unnecessary include 2018-01-23 15:22:13 -03:00
regex Update copyright for 2018 2018-01-02 23:30:12 -05:00
replication Fix typo in recent commit 2018-01-19 06:36:17 +00:00
rewrite Replace AclObjectKind with ObjectType 2018-01-19 14:01:15 -05:00
snowball Update copyright for 2018 2018-01-02 23:30:12 -05:00
statistics Update copyright for 2018 2018-01-02 23:30:12 -05:00
storage Fix Latin spelling 2018-01-11 08:32:01 -05:00
tcop Transaction control in PL procedures 2018-01-22 08:43:06 -05:00
tsearch Update copyright for 2018 2018-01-02 23:30:12 -05:00
utils Split out documentation of SSL parameters into their own section 2018-01-23 07:11:38 -05:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Add ICU_CFLAGS to global CPPFLAGS 2017-06-12 15:57:22 -04:00
Makefile Update copyright for 2018 2018-01-02 23:30:12 -05:00
nls.mk Translation updates 2017-05-15 12:19:54 -04:00