Re: Oddity with NOT IN

From: Marko Tiikkaja <marko(at)joh(dot)to>
To: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Oddity with NOT IN
Date: 2016-08-04 21:53:53
Message-ID: 5894188e-52db-aa1f-dae1-742ded0820a0@joh.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2016-08-04 11:23 PM, Jim Nasby wrote:
> I've got a customer that discovered something odd...
>
> SELECT f1 FROM v1 WHERE f2 not in (SELECT bad FROM v2 WHERE f3 = 1);
>
> does not error, even though bad doesn't exist, but

I'm guessing there's a v1.bad?

This is a common mistake, and also why I recommend always table
qualifying column references when there's more than one table in scope.

.m

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2016-08-04 22:16:45 Re: New version numbering practices
Previous Message Jim Nasby 2016-08-04 21:23:46 Oddity with NOT IN