From: Kevin Perais <kevin.perais@trivia-marketing.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@postgresql.org <pgsql-bugs@postgresql.org>
Subject: Re: BUG #12556: Clause IN and NOT IN buggy
Date: Fri, 16 Jan 2015 09:17:43 +0000
Message-ID: <46C6B6B27EF7AA489BBDF478BF05B5D2BD886818@server.exchange.local> (raw)
In-Reply-To: <6445.1421341526@sss.pgh.pa.us>
References: <20150115112720.2502.55131@wrigleys.postgresql.org>
<6445.1421341526@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
Hi,
I must disagree with you.
There is enough info to understand what goes wrong. I've run enough queries to inspect data.
The fact that the query with IN does not returns the same result as the JOIN knowing that there are NULL values proves it. Please check the results of all the queries together. You'll see that you do not need data and that the results are incoherent! For the 1st case, I even take a value randomly and I didn't find it in the Account table. So the NOT IN query just can't return 0 as there is at least one value that is not present in the Account table ;)
-----Message d'origine-----
De : Tom Lane [mailto:tgl@sss.pgh.pa.us]
Envoyé : jeudi 15 janvier 2015 18:05
À : Kevin Perais
Cc : pgsql-bugs@postgresql.org
Objet : Re: [BUGS] BUG #12556: Clause IN and NOT IN buggy
kevin.perais@trivia-marketing.com writes:
> I've been noticing several times that clauses IN and NOT IN are often buggy.
None of your examples demonstrate any such thing. What's much more likely
is that you've forgotten about NOT IN's weird (but spec-mandated) behavior
with NULLs, and/or misspelled a field name so that the output of the
sub-SELECT is actually an outer reference.
> I'll show you 2 concrete cases to illustrate that.
My idea of a "concrete case" would be something that someone else could
reproduce from the given information, which would certainly require test
data.
regards, tom lane
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
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: kevin.perais@trivia-marketing.com, tgl@sss.pgh.pa.us
Subject: Re: BUG #12556: Clause IN and NOT IN buggy
In-Reply-To: <46C6B6B27EF7AA489BBDF478BF05B5D2BD886818@server.exchange.local>
References: <20150115112720.2502.55131@wrigleys.postgresql.org> <6445.1421341526@sss.pgh.pa.us> <46C6B6B27EF7AA489BBDF478BF05B5D2BD886818@server.exchange.local>
* 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