From: | Teodor Sigaev <teodor(at)sigaev(dot)ru> |
---|---|
To: | pgsql-bugs(at)postgresql(dot)org |
Subject: | ERROR: failed to build any 4-way joins |
Date: | 2006-12-12 19:03:31 |
Message-ID: | 457EFD03.10903@sigaev.ru |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
Test suite (as simple as I can produce):
CREATE TABLE foo (a int, b int);
INSERT INTO foo VALUES (1,2);
INSERT INTO foo VALUES (2,3);
INSERT INTO foo VALUES (3,3);
CREATE VIEW fooview AS
SELECT
f1.a AS a_for_max_b
FROM
( SELECT MAX(foo.b) AS MaxB FROM foo ) f2
INNER JOIN foo f1
ON f2.MaxB = f1.b;
And this query fails:
SELECT
*
FROM
fooview fv1
LEFT OUTER JOIN fooview fv2
ON TRUE = TRUE;
It also fails with RIGHT join, but it doesn't fail with INNER or FULL joins.
If view is defined (essentially the same) as
CREATE VIEW fooview AS
SELECT
f1.a AS a_for_max_b
FROM
foo f1
WHERE
f1.b = (SELECT MAX(f2.b) FROM foo f2);
then all is ok.
--
Teodor Sigaev E-mail: teodor(at)sigaev(dot)ru
WWW: http://www.sigaev.ru/
From | Date | Subject | |
---|---|---|---|
Next Message | Teodor Sigaev | 2006-12-12 19:04:59 | Re: ERROR: failed to build any 4-way joins |
Previous Message | Tom Lane | 2006-12-12 17:03:41 | Re: User-defined type name begins with the underscore character (_) can be created |