Re: Errors "failed to construct the join relation" and "failed to build any 2-way joins"

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Will Leinweber <will@bitfission.com>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2019-12-13T06:26:11Z
Lists: pgsql-hackers
Will Leinweber <will@bitfission.com> writes:
> On 12.1, fresh initdb the following query gives me the error
> "ERROR:  failed to construct the join relation"

I'm getting an assertion failure in an assert-enabled build, here:

(gdb) f 3
#3  0x00000000006f382a in create_lateral_join_info (root=0x2d380c8)
    at initsplan.c:637
637                     Assert(!bms_is_member(rti, lateral_relids));

Eyeing the plan produced by v11, I'm suspecting some oversight in
the RTE_RESULT changes (4be058fe9); but I haven't actually bisected.
Too tired to look closer right now.

			regards, tom lane



Commits

  1. Prevent overly-aggressive collapsing of joins to RTE_RESULT relations.