Re: BUG #3384: Subselects on joins show columns not in the join query.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Adam Buchbinder" <adam(at)support(dot)uroweb(dot)net>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #3384: Subselects on joins show columns not in the join query.
Date: 2007-06-13 18:18:20
Message-ID: 14943.1181758700@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"Adam Buchbinder" <adam(at)support(dot)uroweb(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Prasad 2007-06-14 08:42:51 BUG #3385: Memory leak
Previous Message Adam Buchbinder 2007-06-13 16:51:22 BUG #3384: Subselects on joins show columns not in the join query.