BUG #5122: Subqueries - inner select statement bug - Mailing list pgsql-bugs

From Muris Pucic
Subject BUG #5122: Subqueries - inner select statement bug
Date
Msg-id 200910160726.n9G7QEEg097413@wwwmaster.postgresql.org
Whole thread Raw
Responses Re: BUG #5122: Subqueries - inner select statement bug
Re: BUG #5122: Subqueries - inner select statement bug
Re: BUG #5122: Subqueries - inner select statement bug
List pgsql-bugs
The following bug has been logged online:

Bug reference:      5122
Logged by:          Muris Pucic
Email address:      trax@multicom.ba
PostgreSQL version: 8.2
Operating system:   Vista
Description:        Subqueries - inner select statement bug
Details:

Hi,

If we have two simple tables:

TABLE1
------
id
first_name

TABLE2
------
id
last_name

##############
EXAMPLE QUERY:
##############

-- The query below works, even though there is no column "first_name" in
TABLE2. This should return an error but it does not, it returns all rows
from TABLE1. This query should not evaluate correctly even when aliases are
not used because it can be misleading.

SELECT * FROM TABLE1 WHERE first_name IN (SELECT first_name FROM TABLE2)


-- The query below works as expected

SELECT * FROM TABLE1 WHERE first_name IN (SELECT last_name FROM TABLE2)


Regards,
Muris

www.elektronika.ba

pgsql-bugs by date:

Previous
From: "Douglas, Ryan"
Date:
Subject: Re: BUG #5121: Segmentation Fault when using pam w/ krb5
Next
From: "Andrey"
Date:
Subject: BUG #5123: bug in window function "last_value"