pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #14105: regression for right join - failed to build any 2-way joins
3+ messages / 3 participants
[nested] [flat]

* BUG #14105: regression for right join - failed to build any 2-way joins
@ 2016-04-20 19:47  vojta.rylko@gmail.com
  0 siblings, 2 replies; 3+ messages in thread

From: vojta.rylko@gmail.com @ 2016-04-20 19:47 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      14105
Logged by:          Vojtech Rylko
Email address:      vojta.rylko@gmail.com
PostgreSQL version: 9.5.2
Operating system:   Linux version 3.16.0-30-generic
Description:        

I have problem with right join which uses coalesce in join condition. With
other type of join or without coalesce query works.

Minimal reproducer:

create table a as (select 1 as id);
select *
from ((
       a as a1
       full join (select 1 as id) as tt
       on (a1.id = tt.id)
      )
      right join (select 1 as id) as tt2
      on (coalesce(tt.id) = tt2.id)
     )
;
ERROR:  XX000: failed to build any 2-way joins
LOCATION:  standard_join_search, allpaths.c:1832


It works on PostgreSQL 9.2.13., returning:
 id | id | id 
----+----+----
  1 |  1 |  1
(1 row)

Cheers,
V.



-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: BUG #14105: regression for right join - failed to build any 2-way joins
@ 2016-04-21 21:18  David G. Johnston <david.g.johnston@gmail.com>
  parent: vojta.rylko@gmail.com
  1 sibling, 0 replies; 3+ messages in thread

From: David G. Johnston @ 2016-04-21 21:18 UTC (permalink / raw)
  To: vojta.rylko@gmail.com; +Cc: pgsql-bugs

On Wed, Apr 20, 2016 at 12:47 PM, <vojta.rylko@gmail.com> wrote:

> The following bug has been logged on the website:
>
> Bug reference:      14105
> Logged by:          Vojtech Rylko
> Email address:      vojta.rylko@gmail.com
> PostgreSQL version: 9.5.2
> Operating system:   Linux version 3.16.0-30-generic
> Description:
>
> I have problem with right join which uses coalesce in join condition. With
> other type of join or without coalesce query works.
>
> Minimal reproducer:
>
> create table a as (select 1 as id);
> select *
> from ((
>        a as a1
>        full join (select 1 as id) as tt
>        on (a1.id = tt.id)
>       )
>       right join (select 1 as id) as tt2
>       on (coalesce(tt.id) = tt2.id)
>      )
> ;
> ERROR:  XX000: failed to build any 2-way joins
> LOCATION:  standard_join_search, allpaths.c:1832
>
>
> It works on PostgreSQL 9.2.13., returning:
>  id | id | id
> ----+----+----
>   1 |  1 |  1
> (1 row)
>
> Cheers,
> V.
>

​Sounds familiar...

Anyway I confirmed on 9.5.2​

​and also see it on 9.3.12

No ready access to 9.4 or 9.2

David J.
​

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: BUG #14105: regression for right join - failed to build any 2-way joins
@ 2016-04-22 00:06  Tom Lane <tgl@sss.pgh.pa.us>
  parent: vojta.rylko@gmail.com
  1 sibling, 0 replies; 3+ messages in thread

From: Tom Lane @ 2016-04-22 00:06 UTC (permalink / raw)
  To: vojta.rylko@gmail.com; +Cc: pgsql-bugs

vojta.rylko@gmail.com writes:
> I have problem with right join which uses coalesce in join condition. With
> other type of join or without coalesce query works.

I've pushed a fix for this.  Thanks for the report and test case!

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2016-04-22 00:06 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-04-20 19:47 BUG #14105: regression for right join - failed to build any 2-way joins vojta.rylko@gmail.com
2016-04-21 21:18 ` David G. Johnston <david.g.johnston@gmail.com>
2016-04-22 00:06 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox