Re: Query should have failed, but didn't?

From: "David Johnston" <polobo(at)yahoo(dot)com>
To: "'Royce Ausburn'" <royce(at)inomial(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Query should have failed, but didn't?
Date: 2011-03-02 03:38:42
Message-ID: 045901cbd88b$5403f3b0$fc0bdb10$@yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michał Koba 2011-03-02 06:42:46 Comparing md5 hash with md5 password hash
Previous Message Royce Ausburn 2011-03-02 03:34:39 Re: Query should have failed, but didn't?