Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-bugs by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group