Re: BUG #6209: Invalid subquery is accepted within a IN() clause

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Marc Mamin <marc(at)intershop(dot)de>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #6209: Invalid subquery is accepted within a IN() clause
Date: 2011-09-16 11:06:01
Message-ID: 4E732D99.7050307@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Norman Palardy 2011-09-16 14:41:34 BUG #6210: Description of PQconnectdbParams in documentation
Previous Message Thomas Kellerer 2011-09-16 10:02:32 Re: Problem with the 9.1 one-click installer Windows7 64bit