Re: BUG #5263: Query execution fails with "ERROR: FULL JOIN is only supported with merge-joinable join conditions" - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #5263: Query execution fails with "ERROR: FULL JOIN is only supported with merge-joinable join conditions"
Date
Msg-id 15477.1262726235@sss.pgh.pa.us
Whole thread Raw
In response to BUG #5263: Query execution fails with "ERROR: FULL JOIN is only supported with merge-joinable join conditions"  ("Jozsef Szalay" <jszalay@storediq.com>)
Responses Re: BUG #5263: Query execution fails with "ERROR: FULL JOIN is only supported with merge-joinable join conditions"
List pgsql-bugs
"Jozsef Szalay" <jszalay@storediq.com> writes:
> Execute the following query:

> SELECT *
> FROM (SELECT id, 0 AS value
>       FROM test
>       WHERE description = 'abc'
>      ) t1
>      FULL OUTER JOIN
>      (SELECT id, 1 AS value
>       FROM test
>       WHERE description = 'def'
>      ) t2 USING (id, value);

Hm.  It's reducing the join condition to constant FALSE (since 0<>1) and
then deciding it doesn't know how to join in that case.  While this is
certainly undesirable, I have to wonder about the purpose of the query.
It seems like this is just a remarkably inefficient way of performing
UNION ALL.  Do you have a more real-world case where it happens?

            regards, tom lane

pgsql-bugs by date:

Previous
From: "robson"
Date:
Subject: BUG #5266: erros no servidor web
Next
From: Jozsef Szalay
Date:
Subject: Re: BUG #5263: Query execution fails with "ERROR: FULL JOIN is only supported with merge-joinable join conditions"