Re: Optimizer failed to generate plan - Mailing list pgsql-bugs

From David Rowley
Subject Re: Optimizer failed to generate plan
Date
Msg-id CAApHDvq=MvEosOWazo45YFTkmuOD0qv1_Tz4dvcgem2aDraaDA@mail.gmail.com
Whole thread Raw
In response to Optimizer failed to generate plan  (xianliang.ji@esgyn.cn)
List pgsql-bugs
On Tue, 14 Feb 2023 at 00:18, <xianliang.ji@esgyn.cn> wrote:
> postgres=# select a.*,b.* from EMP a FULL JOIN DEPT b on
> a.deptno=b.deptno OR upper(ename)='BLAKE' where a.job='MANAGER' OR
> b.dname='SALES';
> ERROR:  FULL JOIN is only supported with merge-joinable or hash-joinable

It's not a bug. The problem is the join condition has OR conditions
and we can do a full Hash or Merge join for joins like that.

I'm a bit unclear on what you need exactly, but maybe you could get it
by repeating the query once for each branch of the OR and then
performing a UNION ALL.

David



pgsql-bugs by date:

Previous
From: David Rowley
Date:
Subject: Re: array_agg(DISTINCT) caused a segmentation fault
Next
From: Alexander Lakhin
Date:
Subject: Re: array_agg(DISTINCT) caused a segmentation fault