BUG #4816: NOT IN clause, doesn't work

From: "jose soares" <jose(dot)saores(at)sferacarta(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #4816: NOT IN clause, doesn't work
Date: 2009-05-20 09:37:56
Message-ID: 200905200937.n4K9buYg026401@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 4816
Logged by: jose soares
Email address: jose(dot)saores(at)sferacarta(dot)com
PostgreSQL version: 8.3.5
Operating system: x86_64-pc-linux-gnu, compiled by GCC gcc-4.3.real
(Debian 4.3.2-1) 4.3.2
Description: NOT IN clause, doesn't work
Details:

Hello all,

I'm trying a NOT IN clause, but seems it doesn't work. Please take a look:

mydb=# select distinct id from psop where id_ua = 72492;
id
-------
56844
67953
67955
(3 rows)

mydb=# select distinct id_sop from scad where id_ua = 72492;
----------------
56844
67953

(3 rows)

mydb=# select distinct id from psop where id_ua = 72492 and id not in
(select distinct id_sop from scad where id_ua = 72492);
id
----
(0 rows)

mydb=# select distinct id from psop where id_ua = 72492 and id not in
(56844,67953);
id
-------
67955
(1 row)

What's wrong with those selects?

j

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Rodriguez Fernando 2009-05-20 11:40:07 Re: BUG #4816: NOT IN clause, doesn't work
Previous Message Rainer Bauer 2009-05-19 12:24:25 Re: BUG #4815: max_connections setting has no impact