Re: extra columns in intermediate nodes not being removed by top level of executor - Mailing list pgsql-bugs

From Michael Fuhr
Subject Re: extra columns in intermediate nodes not being removed by top level of executor
Date
Msg-id 20050903205712.GA2536@winnie.fuhr.org
Whole thread Raw
In response to extra columns in intermediate nodes not being removed by top level of executor  (Allan Wang <allanvv@gmail.com>)
Responses Re: extra columns in intermediate nodes not being removed by top level of executor  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: extra columns in intermediate nodes not being removed by top level of executor  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
On Sat, Sep 03, 2005 at 04:29:25PM -0400, Allan Wang wrote:
> I'm using 8.1 from CVS head of about two days ago.
>
> Extra columns seem to be on sum(plays.length), videos.path, videoid

Here's a simplified, complete test case:

CREATE TABLE foo (
    x  integer,
    y  integer
);

INSERT INTO foo (x, y) VALUES (1, 2);

SELECT * FROM (SELECT sum(x), (SELECT y) AS yy FROM foo GROUP BY y) AS s LIMIT 1;
 sum | yy |
-----+----+---
   1 |  2 | 2
(1 row)

SELECT * FROM (SELECT sum(x), (SELECT y) AS yy FROM foo GROUP BY yy) AS s LIMIT 1;
 sum | yy
-----+----
   1 |  2
(1 row)

SELECT * FROM (SELECT sum(x), (SELECT y) AS yy FROM foo GROUP BY y) AS s;
 sum | yy
-----+----
   1 |  2
(1 row)

SELECT * FROM (SELECT sum(x), y AS yy FROM foo GROUP BY y) AS s LIMIT 1;
 sum | yy
-----+----
   1 |  2
(1 row)

SELECT * FROM (SELECT x, (SELECT y) AS yy FROM foo) AS s LIMIT 1;
 x | yy
---+----
 1 |  2
(1 row)

--
Michael Fuhr

pgsql-bugs by date:

Previous
From: Allan Wang
Date:
Subject: extra columns in intermediate nodes not being removed by top level of executor
Next
From: al979663@ucol.mx
Date:
Subject: Error number -2147467259 with driver PgOleDb