From: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
To: Marc Mamin <marc@intershop.de>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #6209: Invalid subquery is accepted within a IN() clause
Date: Fri, 16 Sep 2011 14:06:01 +0300
Message-ID: <4E732D99.7050307@enterprisedb.com> (raw)
In-Reply-To: <201109160959.p8G9xBDu036900@wwwmaster.postgresql.org>
References: <201109160959.p8G9xBDu036900@wwwmaster.postgresql.org>
On 16.09.2011 12:59, Marc Mamin wrote:
> This is not valid, but is accepted.
>
>
> EXPLAIN analyze
> select * from test_f_files_steps where id in
> (select id from
> (
> select file_id,class_id from test_f_files_steps
> EXCEPT
> select id,class_id from test_f_files_status
> )foo
> )
It is valid, it just doesn't do what you might expect. The "id" in
"select id from (..." refers to the id field in the outer query.
--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: heikki.linnakangas@enterprisedb.com, marc@intershop.de
Subject: Re: BUG #6209: Invalid subquery is accepted within a IN() clause
In-Reply-To: <4E732D99.7050307@enterprisedb.com>
References: <201109160959.p8G9xBDu036900@wwwmaster.postgresql.org> <4E732D99.7050307@enterprisedb.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox