Oddity with NOT IN - Mailing list pgsql-hackers

From Jim Nasby
Subject Oddity with NOT IN
Date
Msg-id 03c431b7-0e7e-7f61-f2f0-f6fa9a063167@BlueTreble.com
Whole thread Raw
Responses Re: Oddity with NOT IN  (Marko Tiikkaja <marko@joh.to>)
List pgsql-hackers
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

SELECT bad FROM v2 WHERE f3 = 1;
gives

ERROR:  column "bad" does not exist

Is that expected?

This is on 9.4.8, and both v1 and v2 are views. The only "odd" thing 
that I see is that v1 is a UNION ALL and v2 is a UNION. I don't think 
there's any tables in common between the two views.
-- 
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com
855-TREBLE2 (855-873-2532)   mobile: 512-569-9461



pgsql-hackers by date:

Previous
From: Jeff Janes
Date:
Subject: Re: Pgbench performance tuning?
Next
From: Marko Tiikkaja
Date:
Subject: Re: Oddity with NOT IN