Seamus Abshere <sea...@abshere.net> writes:
> Should there be a warning for the first query that you reference "tracks" in 
> a subquery but don't use any columns from it?

Unfortunately, outer references in subqueries are perfectly legal per SQL
standard, and also often essential.

If we were to invent a "SET training_wheels = on" option, it would surely
include some warnings in this area, although I'm not sure exactly what the
triggering conditions ought to be.  But there are lots of ways to mess
yourself up in SQL; I don't think subqueries are that much worse than
some other gotchas.

                        regards, tom lane

Reply via email to