Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Y207Z-0003vm-0k for pgsql-bugs@arkaria.postgresql.org; Fri, 19 Dec 2014 16:09:41 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Y207Y-00064Z-Hp for pgsql-bugs@arkaria.postgresql.org; Fri, 19 Dec 2014 16:09:40 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Y207X-00064T-Rv for pgsql-bugs@postgresql.org; Fri, 19 Dec 2014 16:09:40 +0000 Received: from mwork.nabble.com ([162.253.133.43]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Y207U-0001ax-L6 for pgsql-bugs@postgresql.org; Fri, 19 Dec 2014 16:09:38 +0000 Received: from msam.nabble.com (unknown [162.253.133.85]) by mwork.nabble.com (Postfix) with ESMTP id 3E1C0E35EC6 for ; Fri, 19 Dec 2014 08:09:36 -0800 (PST) Date: Fri, 19 Dec 2014 09:09:35 -0700 (MST) From: David G Johnston To: pgsql-bugs@postgresql.org Message-ID: <1419005375461-5831501.post@n5.nabble.com> In-Reply-To: References: <20141218213959.1903.81488@wrigleys.postgresql.org> <20141218215458.GR1768@alvh.no-ip.org> Subject: Re: BUG #12276: Using old name of a renamed or dropped column in a sub-query does not throw error MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -0.3 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org collin.peters wrote > Wow, an amazing 'feature' for sure. Is there any use case where it > actually > makes sense? I'm just wondering if this is a case where it is better to > stray from the spec? Would almost prefer a 'NOTICE' if you use an > unqualified column reference in a sub-query. Correlated subqueries must be able to see values in the outer relation to function. Those are quite useful. Since not everything needs or wants to be table qualified it becomes difficult to selectively enforce such a requirement. Two possible solutions... 1. All correlated subqueries need to have external-able columns explicitly prefixed 2. All normal subquery columns with two possible name resolutions need to be prefixed The first option causes your post-rename to fail but the original query works. The second option causes the original query to fail but the post-rename one works. You can require both and both queries fail. I'm not saying I support these...though the option would be nice to prevent just this sort of thing. David J. -- View this message in context: http://postgresql.nabble.com/BUG-12276-Using-old-name-of-a-renamed-or-dropped-column-in-a-sub-query-does-not-throw-error-tp5831401p5831501.html Sent from the PostgreSQL - bugs mailing list archive at Nabble.com. -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs