Re: Query should have failed, but didn't? - Mailing list pgsql-general

From David Johnston
Subject Re: Query should have failed, but didn't?
Date
Msg-id 045901cbd88b$5403f3b0$fc0bdb10$@yahoo.com
Whole thread Raw
In response to Query should have failed, but didn't?  (Royce Ausburn <royce@inomial.com>)
List pgsql-general
This is not a bug; given your test queries whenever you reference “id1” you
are ALWAYS referencing the column “id1” in table “test2”.

>>test=# select * from test2 where id1 in (select id1 from test1) and
charge=70;
>> id1 | charge 
>>-----+--------
>>  10 |     70
>> (1 row)

Hint: Consider the results of:

SELECT ‘literal’ FROM table1;

AND

SELECT
t1.*,
(SELECT t2.col2 FROM t2 WHERE t2.id = t1.id)
FROM t1;

David J.



pgsql-general by date:

Previous
From: Andy Colson
Date:
Subject: Re: Query should have failed, but didn't?
Next
From: Royce Ausburn
Date:
Subject: Re: Query should have failed, but didn't?