subselect on nonexistent column succeeds!!?!

Поиск
Список
Период
Сортировка
От James Robinson
Тема subselect on nonexistent column succeeds!!?!
Дата
Msg-id 3A1943AE-CB89-11D8-8888-000A9566A412@socialserve.com
обсуждение исходный текст
Ответы Re: subselect on nonexistent column succeeds!!?!  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Список pgsql-bugs
Given:

orig_sav=# \d realtycompany_contacts
  Table "public.realtycompany_contacts"
       Column      |  Type  | Modifiers
------------------+--------+-----------
  realtycompany_id | bigint | not null
  contact_id       | bigint | not null


and

orig_sav=# \d users
                     Table "public.users"
       Column       |            Type             | Modifiers
-------------------+-----------------------------+-----------
  id                | bigint                      | not null
  name              | text                        |
  password          | text                        | not null
  version           | integer                     | not null
  contact           | bigint                      |
  comment           | text                        |
  organization      | bigint                      |
  pwd_storage_style | integer                     |
  old_name          | text                        |
  deleted           | boolean                     | not null
  deleted_date      | timestamp without time zone |


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.


orig_sav=# select contact_id from users;
ERROR:  column "contact_id" does not exist

This is on 7.4.2.


----
James Robinson
Socialserve.com

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

Предыдущее
От: "Jerome Chochon"
Дата:
Сообщение: Problem to increase name data length
Следующее
От: Ilir Gashi
Дата:
Сообщение: Possible bug?