| От | Heikki Linnakangas |
|---|---|
| Тема | Re: BUG #4742: wrong resultset instead of syntax error |
| Дата | |
| Msg-id | 49D1D666.7060600@enterprisedb.com обсуждение исходный текст |
| Ответ на | BUG #4742: wrong resultset instead of syntax error ("Slava Moudry" <smoudry@4info.net>) |
| Список | pgsql-bugs |
Slava Moudry wrote: > I believe this is a parser error, it should fail rather than return all rows > from keyword since there is no keyword_id in carrier table. The same can be > illustrated with any other tables: > > smslocate_edw=# select count(*) from keyword where keyword_id in (select > keyword_id from carrier) It's not a bug, although I admit I've done the same mistake myself many times. keyword_id refers to keyword.keyword_id from the outer query in this case. It makes sense if you think of a more complex query like: select count(*) from keyword where keyword_ratio > (select keyword_id / carrier_id from carrier) If keyword_id wasn't allowed in the subquery, it would be impossible to write more complex queries like that. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com
В списке pgsql-bugs по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера