Re: subselect on nonexistent column succeeds!!?!

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: subselect on nonexistent column succeeds!!?!
Дата
Msg-id 20040701123253.Q35614@megazone.bigpanda.com
обсуждение исходный текст
Ответ на subselect on nonexistent column succeeds!!?!  (James Robinson <jlrobins@socialserve.com>)
Список pgsql-bugs
On Thu, 1 Jul 2004, James Robinson wrote:

> Why in the world does this statement parse and run:
>
> orig_sav=# delete from realtycompany_contacts where contact_id in
> (select contact_id from users);
> DELETE 1634
>
> Since users has *no* column contact_id ? One would expect the statement
> to fail, and the transaction to get rolled back.

AFAIK the spec requires that subselects like that can reference outer
columns so contact_id inside the subselect refers to the outer contact_id
column which does exist (which makes the effective behavior of the above
clause the same as contact_id is not null I think)

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

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: Possible bug?
Следующее
От: Eric AVRILLON
Дата:
Сообщение: problem installing on aix 4.3.3