Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W8tGn-0008QU-A0 for pgsql-bugs@arkaria.postgresql.org; Thu, 30 Jan 2014 15:11:09 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1W8tGm-0006i8-Ph for pgsql-bugs@arkaria.postgresql.org; Thu, 30 Jan 2014 15:11:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W8tGl-0006gm-Gj for pgsql-bugs@postgresql.org; Thu, 30 Jan 2014 15:11:07 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W8tGh-0008Cr-EZ for pgsql-bugs@postgresql.org; Thu, 30 Jan 2014 15:11:06 +0000 MIME-Version: 1.0 Subject: BUG #9041: Strange error message with LATERAL and mixed WHERE/ON conditions To: pgsql-bugs@postgresql.org From: levertond@googlemail.com Date: Thu, 30 Jan 2014 15:10:03 +0000 Message-ID: <20140130151003.25475.92981@wrigleys.postgresql.org> X-Pg-Spam-Score: -0.3 (/) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org The following bug has been logged on the website: Bug reference: 9041 Logged by: David Leverton Email address: levertond@googlemail.com PostgreSQL version: 9.3.2 Operating system: Oracle Enterprise Linux 5 x86_64 Description: 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. (For the record, the mixture of WHERE and ON is because in the real query, the LATERAL subquery including the WHERE clause is actually an inlineable SRF call.) Postgres was installed using the pgrpms.org packages, and all settings other than listen_addresses are at their default values. -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs