Re: trecherous subselect needs warning? - Mailing list pgsql-sql

From Tom Lane
Subject Re: trecherous subselect needs warning?
Date
Msg-id 27137.1139334353@sss.pgh.pa.us
Whole thread Raw
In response to trecherous subselect needs warning?  (george young <gry@ll.mit.edu>)
Responses Re: trecherous subselect needs warning?  (george young <gry@ll.mit.edu>)
List pgsql-sql
george young <gry@ll.mit.edu> writes:
> This query returns zero rows:

> newschm3=# select run_id from s_bake where opset_id not in (select opset_id from opset_steps);
>  run_id
> --------
> (0 rows)

> But, by my mistake, table opset_steps has no column "opset_id"!
> Surely it should return an error, or at least a warning, not just an
> empty rowset.

Access to upper-level variables from subqueries is (a) useful and (b)
required by the SQL spec, so we are not going to start throwing warnings
about it.
        regards, tom lane


pgsql-sql by date:

Previous
From: Richard Huxton
Date:
Subject: Re: Filtering data based on timestamp
Next
From: george young
Date:
Subject: Re: trecherous subselect needs warning?