X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 194E79DCB6D for ; Tue, 7 Feb 2006 13:45:56 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 08200-06 for ; Tue, 7 Feb 2006 13:45:55 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id B583F9DCB78 for ; Tue, 7 Feb 2006 13:45:53 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id k17HjrlD027138; Tue, 7 Feb 2006 12:45:53 -0500 (EST) To: gry@ll.mit.edu cc: pgsql-sql@postgresql.org Subject: Re: trecherous subselect needs warning? In-reply-to: <20060207120110.5d5f3c44.gry@ll.mit.edu> References: <20060207120110.5d5f3c44.gry@ll.mit.edu> Comments: In-reply-to george young message dated "Tue, 07 Feb 2006 12:01:10 -0500" Date: Tue, 07 Feb 2006 12:45:53 -0500 Message-ID: <27137.1139334353@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.108 required=5 tests=[AWL=0.108] X-Spam-Score: 0.108 X-Spam-Level: X-Archive-Number: 200602/68 X-Sequence-Number: 24078 george young 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