Search Postgresql Archives

warning for subquery that references a table but not its columns

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I almost got bit by this today:

=> select email from subscribed where email not in (select email from tracks);
 email
-------
(0 rows)

=> select email from subscribed where email not in (select tracks.email from tracks);
ERROR:  column tracks.email does not exist
LINE 1: ... email from subscribed where email not in (select tracks.ema...

(the "tracks" table doesn't have an "email" column, so the first query is just meaningless)

Should there be a warning for the first query that you reference "tracks" in a subquery but don't use any columns from it?

--
Seamus Abshere, SCEA
https://www.faraday.io
https://github.com/seamusabshere
https://linkedin.com/in/seamusabshere




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux