Re: BUG #6209: Invalid subquery is accepted within a IN() clause - Mailing list pgsql-bugs

From Heikki Linnakangas
Subject Re: BUG #6209: Invalid subquery is accepted within a IN() clause
Date
Msg-id 4E732D99.7050307@enterprisedb.com
Whole thread Raw
In response to BUG #6209: Invalid subquery is accepted within a IN() clause  ("Marc Mamin" <marc@intershop.de>)
List pgsql-bugs
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

pgsql-bugs by date:

Previous
From: "Marc Mamin"
Date:
Subject: BUG #6209: Invalid subquery is accepted within a IN() clause
Next
From: pratikchirania
Date:
Subject: Timezone issues with Postrres