postgresql/src/backend
Tom Lane c5e59bb602 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 Report an ERROR if a parallel worker fails to start properly. 2018-01-23 11:13:42 -05:00
bootstrap Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
catalog Fix assorted syscache lookup sloppiness in partition-related code. 2017-11-27 19:22:08 -05:00
commands Fix StoreCatalogInheritance1 to use 32bit inhseqno 2018-01-19 10:15:08 -03:00
executor When passing query strings to workers, pass the terminating \0. 2017-12-20 17:27:25 -05:00
foreign Abstract logic to allow for multiple kinds of child rels. 2017-04-03 22:41:31 -04:00
lib Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
libpq Accept SCRAM channel binding enabled clients 2017-12-08 10:17:46 -05:00
main Install Windows crash dump handler before all else. 2017-11-12 14:31:04 -08:00
nodes Force rescanning of parallel-aware scan nodes below a Gather[Merge]. 2017-08-30 09:29:56 -04:00
optimizer Teach reparameterize_path() to handle AppendPaths. 2018-01-23 16:50:34 -05:00
parser Fix typo 2017-12-09 14:48:08 +01:00
po Translation updates 2017-11-05 17:00:29 -05:00
port Change pg_ctl to detect server-ready by watching status in postmaster.pid. 2017-06-28 17:31:32 -04:00
postmaster Remove unnecessary include 2018-01-23 15:22:37 -03:00
regex Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
replication Fix race condition during replication origin drop. 2018-01-09 12:09:30 -05:00
rewrite Fix creation of resjunk tlist entries for inherited mixed UPDATE/DELETE. 2017-11-27 17:54:09 -05:00
snowball Initial pgindent run with pg_bsd_indent version 2.0. 2017-06-21 14:39:04 -04:00
statistics Support boolean columns in functional-dependency statistics. 2017-12-04 11:51:43 -05:00
storage Remove dubious micro-optimization in ckpt_buforder_comparator(). 2018-01-10 15:50:54 -05:00
tcop Prevent idle in transaction session timeout from sometimes being ignored. 2017-10-11 14:02:41 -07:00
tsearch Improve make_tsvector() to handle empty input, and simplify its callers. 2017-07-18 13:13:47 -04:00
utils Fix pruning of locked and updated tuples. 2017-12-14 18:20:48 -08: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 Inject $(ICU_LIBS) regardless of platform. 2017-08-20 21:22:33 -07:00
nls.mk Translation updates 2017-09-11 12:49:35 -04:00