From: Szűcs Gábor <surrano@gmail.com>
To: pgsql-bugs@postgresql.org <pgsql-bugs@postgresql.org>
To: pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>
Subject: Re: could not devise a query plan
Date: Tue, 24 May 2005 12:39:04 +0200
Message-ID: <42930447.2030801@gmail.com> (raw)
In-Reply-To: <05d801c41bd8$daf4f8f0$0403a8c0@fejleszt4>
References: <05d801c41bd8$daf4f8f0$0403a8c0@fejleszt4>
Dear Gurus,
Sorry for upping a 13-month-old thread; please tell if I should've opened
another one.
Here I come again, with another silly join. Please forgive me, but our
queries are built from blocks :)
VERSION: 7.4.6, 7.4.8, 8.0.0rc4 (sorry, no newer installed right now)
ABSTRACT: The following query fails.
SELECT * FROM
(SELECT a,b FROM cdqp WHERE a=1 AND b=2) AS aa
NATURAL FULL JOIN
(SELECT a,b FROM cdqp WHERE a=1 and b=2) AS bb
WHERE a+b = 3;
DETAILS: It seems it's something about the redundant WHERE clauses. If I
comment (replace with "WHERE true") any of the three WHERE clauses, it works.
Session log: See below.
TIA,
--
G.
serv1:tir=> \d cdqp
Table "pg_temp_20.cdqp"
Column | Type | Modifiers
--------+---------+-----------
a | integer |
b | integer |
serv1:tir=> SELECT * FROM
serv1:tir-> (SELECT a,b FROM cdqp WHERE a=1 AND b=2) AS aa
serv1:tir-> NATURAL FULL JOIN
serv1:tir-> (SELECT a,b FROM cdqp WHERE a=1 and b=2) AS bb
serv1:tir-> WHERE a+b = 3;
ERROR: could not devise a query plan for the given query
serv1:tir=> SELECT * FROM
serv1:tir-> (SELECT a,b FROM cdqp WHERE a=1 AND b=2) AS aa
serv1:tir-> NATURAL FULL JOIN
serv1:tir-> (SELECT a,b FROM cdqp WHERE a=1 and b=2) AS bb
serv1:tir-> WHERE true;
a | b
---+---
1 | 2
(1 row)
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 using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: surrano@gmail.com, pgsql-bugs@postgresql.org
Subject: Re: could not devise a query plan
In-Reply-To: <42930447.2030801@gmail.com>
* 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