Re: BUG #3384: Subselects on joins show columns not in the join query. - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #3384: Subselects on joins show columns not in the join query.
Date
Msg-id 14943.1181758700@sss.pgh.pa.us
Whole thread Raw
In response to BUG #3384: Subselects on joins show columns not in the join query.  ("Adam Buchbinder" <adam@support.uroweb.net>)
List pgsql-bugs
"Adam Buchbinder" <adam@support.uroweb.net> writes:
> Run these queries:

> SELECT otherfield FROM joinview WHERE fname='Quux';

> SELECT otherfield FROM firsttab WHERE otherfield IN (SELECT otherfield FROM
> joinview WHERE fname='Quux');

> SELECT otherfield FROM firsttab WHERE otherfield IN (SELECT otherfield FROM
> joinview WHERE fname='Bar');

> The first query returns an error, but the other two do not;

This is not a bug, it's a standard outer-reference construction.  See
any SQL book for details.

            regards, tom lane

pgsql-bugs by date:

Previous
From: "Adam Buchbinder"
Date:
Subject: BUG #3384: Subselects on joins show columns not in the join query.
Next
From: "Prasad"
Date:
Subject: BUG #3385: Memory leak