BUG #5122: Subqueries - inner select statement bug

From: "Muris Pucic" <trax(at)multicom(dot)ba>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #5122: Subqueries - inner select statement bug
Date: 2009-10-16 07:26:14
Message-ID: 200910160726.n9G7QEEg097413@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 5122
Logged by: Muris Pucic
Email address: trax(at)multicom(dot)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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Andrey 2009-10-16 07:54:39 BUG #5123: bug in window function "last_value"
Previous Message Douglas, Ryan 2009-10-16 05:27:40 Re: BUG #5121: Segmentation Fault when using pam w/ krb5