Re: trecherous subselect needs warning?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: gry(at)ll(dot)mit(dot)edu
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: trecherous subselect needs warning?
Date: 2006-02-07 17:45:53
Message-ID: 27137.1139334353@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

george young <gry(at)ll(dot)mit(dot)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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message george young 2006-02-07 19:17:51 Re: trecherous subselect needs warning?
Previous Message Richard Huxton 2006-02-07 17:03:07 Re: Filtering data based on timestamp