postgresql/src/backend/optimizer/path
Tom Lane a6492ff897 Fix an oversight in checking whether a join with LATERAL refs is legal.
In many cases, we can implement a semijoin as a plain innerjoin by first
passing the righthand-side relation through a unique-ification step.
However, one of the cases where this does NOT work is where the RHS has
a LATERAL reference to the LHS; that makes the RHS dependent on the LHS
so that unique-ification is meaningless.  joinpath.c understood this,
and so would not generate any join paths of this kind ... but join_is_legal
neglected to check for the case, so it would think that we could do it.
The upshot would be a "could not devise a query plan for the given query"
failure once we had failed to generate any join paths at all for the bogus
join pair.

Back-patch to 9.3 where LATERAL was added.
2015-07-31 19:26:33 -04:00
..
allpaths.c Make entirely-dummy appendrels get marked as such in set_append_rel_size. 2015-07-26 16:19:08 -04:00
clausesel.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
costsize.c Redesign tablesample method API, and do extensive code review. 2015-07-25 14:39:00 -04:00
equivclass.c Move strategy numbers to include/access/stratnum.h 2015-05-15 17:03:16 -03:00
indxpath.c Collection of typo fixes. 2015-05-20 16:56:22 +03:00
joinpath.c Code review for foreign/custom join pushdown patch. 2015-05-10 14:36:36 -04:00
joinrels.c Fix an oversight in checking whether a join with LATERAL refs is legal. 2015-07-31 19:26:33 -04:00
Makefile Extract restriction OR clauses whether or not they are indexable. 2013-12-30 12:24:37 -05:00
pathkeys.c Move strategy numbers to include/access/stratnum.h 2015-05-15 17:03:16 -03:00
tidpath.c Update copyright for 2015 2015-01-06 11:43:47 -05:00