For the below test case shouldn't the update statement throw error because the sub query projects a column which is not existing in the table. For ex in inner select nos1 column exists in t1 and not t2.
Is this a bug or an OP error?
template1=# SELECT version();
version
----------------------------------------------------------------------------------------------------------------
PostgreSQL 9.1.6 on x86_64-unknown-linux-gnu, compiled by gcc-4.4.real (Ubuntu 4.4.3-4ubuntu5.1) 4.4.3, 64-bit
(1 row)
template1=# \d t1
Table "public.t1"
Column | Type | Modifiers
--------+---------+-----------
nos1 | integer |
template1=# \d t2
Table "public.t2"
Column | Type | Modifiers
--------+---------+-----------
nos2 | integer |
template1=# UPDATE t1 set nos1=2 where nos1 in (select nos1 from t2);
UPDATE 0
template1=#
Thanks,
Sivakumar.K