Re: warning for subquery that references a table but not its columns

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: warning for subquery that references a table but not its columns
Дата
Msg-id 15194.1516333782@sss.pgh.pa.us
обсуждение исходный текст
Ответ на warning for subquery that references a table but not its columns  (Seamus Abshere <seamus@abshere.net>)
Список pgsql-general
Seamus Abshere <seamus@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
fromit? 

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


В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Possible hang in 10.1 with JSON query over partially indexed partitions
Следующее
От: Abhra Kar
Дата:
Сообщение: Re: Call sql function in psql