Skip site navigation (1) Skip section navigation (2)

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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Jozsef Szalay" <jszalay(at)storediq(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5263: Query execution fails with "ERROR: FULL JOIN is only supported with merge-joinable join conditions"
Date: 2010-01-05 21:17:15
Message-ID: 15477.1262726235@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
"Jozsef Szalay" <jszalay(at)storediq(dot)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

In response to

Responses

pgsql-bugs by date

Next:From: Jozsef SzalayDate: 2010-01-05 22:20:18
Subject: Re: BUG #5263: Query execution fails with "ERROR: FULL JOIN is only supported with merge-joinable join conditions"
Previous:From: robsonDate: 2010-01-05 19:21:15
Subject: BUG #5266: erros no servidor web

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group