pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: gry@ll.mit.edu
Cc: pgsql-sql@postgresql.org
Subject: Re: trecherous subselect needs warning?
Date: Tue, 07 Feb 2006 12:45:53 -0500
Message-ID: <27137.1139334353@sss.pgh.pa.us> (raw)
In-Reply-To: <20060207120110.5d5f3c44.gry@ll.mit.edu>
References: <20060207120110.5d5f3c44.gry@ll.mit.edu>

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



view thread (4+ messages)  latest in thread

Message-ID: <27137.1139334353@sss.pgh.pa.us>
Permalink:  ../27137.1139334353@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/27137.1139334353@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, gry@ll.mit.edu
  Subject: Re: trecherous subselect needs warning?
  In-Reply-To: <27137.1139334353@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox