pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: levertond@googlemail.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #9041: Strange error message with LATERAL and mixed WHERE/ON conditions
Date: Thu, 30 Jan 2014 13:41:54 -0500
Message-ID: <3866.1391107314@sss.pgh.pa.us> (raw)
In-Reply-To: <20140130151003.25475.92981@wrigleys.postgresql.org>
References: <20140130151003.25475.92981@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

levertond@googlemail.com writes:
> The following query fails with the message "JOIN qualification cannot refer
> to other relations":

> SELECT *
> FROM (SELECT 1 AS x) x
> CROSS JOIN (SELECT 1 AS y) y
> LEFT JOIN LATERAL (
>   SELECT *
>   FROM (SELECT 1 AS z) z
>   WHERE z.z = x.x
> ) z ON z.z = y.y;

> I don't see why this shouldn't be legal, but if it isn't it should at least
> give a less vague error message.

Yeah, that query looks legal to me too.  It's tripping over a planner bug,
and the error report is from an internal consistency check, which explains
its not-too-user-friendly nature.  Will fix, thanks for the report!

			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



view thread (2+ messages)

Message-ID: <3866.1391107314@sss.pgh.pa.us>
Permalink:  ../3866.1391107314@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3866.1391107314@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, levertond@googlemail.com
  Subject: Re: BUG #9041: Strange error message with LATERAL and mixed WHERE/ON conditions
  In-Reply-To: <3866.1391107314@sss.pgh.pa.us>
  References: <20140130151003.25475.92981@wrigleys.postgresql.org> <3866.1391107314@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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