| От | Tom Lane |
|---|---|
| Тема | Re: Is this a bug? |
| Дата | |
| Msg-id | 16023.1183315940@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Is this a bug? ("Harry Jackson" <harryjackson@gmail.com>) |
| Список | pgsql-general |
"Harry Jackson" <harryjackson@gmail.com> writes:
> If I made a mistake and changed the "id" column to "user_id" then from
> some the statement executes.
> =# delete from map_users_roles where user_id = (select user_id from
> users WHERE username = 'blah');
This is a standard "outer reference" construction, ie, user_id refers to
the field exposed in the outer-level query if there's no match in the
inner query. Possibly the SQL spec authors should have made it a little
harder to invoke an outer reference, but they didn't.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера