Re: Unexpected behaviour, definitely looks like a bug.

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Leshchuk Aleksey <leshchuk(dot)aleksey(at)aurea(dot)com>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: Unexpected behaviour, definitely looks like a bug.
Date: 2019-04-09 23:02:07
Message-ID: CAKFQuwa97GEXrb2XgjaRQmLmTDzAad81trXh3Ajd90trVJAqRA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, Apr 9, 2019 at 3:02 PM Leshchuk Aleksey <leshchuk(dot)aleksey(at)aurea(dot)com>
wrote:

> PostgresQL version 9.4.20
>
>
> WITH test(id, not_id) AS (
> SELECT * FROM (VALUES (1,1), (3,4)) AS t
> ),
>
> test2(id1) AS (
> SELECT * FROM (VALUES (2), (3) ) AS t
> )
> -- SELECT not_id FROM test2 -- ERROR column "not_id" does not exist
> SELECT * FROM test WHERE id IN ( SELECT not_id FROM test2 ); -- <-- not_id selected from test table no ERROR, result is: 1,1
>
> You've introduced a correlated subquery due to insufficient use of table
qualifiers on column names.

https://wiki.postgresql.org/wiki/FAQ#Why_doesn.27t_PostgreSQL_report_a_column_not_found_error_when_using_the_wrong_name_in_a_subquery.3F

David J.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruce Rindahl 2019-04-10 01:17:59 Failure of initdb
Previous Message Nikolay Samokhvalov 2019-04-09 22:03:59 Re: Unexpected behaviour, definitely looks like a bug.